sprof“未找到PLTREL错误"; [英] sprof "PLTREL not found error"

查看:118
本文介绍了sprof“未找到PLTREL错误";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对共享库进行概要分析,但是每当设置了环境变量LD_PROFILE时,我都会得到在对象中找不到PLTREL".是什么赋予了?我缺少某种链接器标志吗?互联网上似乎没有有关此信息. sprof的手册页长约10个字.

I'm trying to profile our shared library, but whenever I have the environmental variable LD_PROFILE set, I get "PLTREL not found in object ". What gives? Is there some sort of linker flag I'm missing or what? There seems to be no information about this on the internets. The man page for sprof is about 10 words long.

推荐答案

是否根据

According to an unanswered question on Google Groups, it looks like you aren't the very first person with this problem.

我认为pltrel的意思是 plt-rel ;在某些 ELF设计说明中,

I think pltrel means plt-relative; in some ELF design notes,

在代码段中创建了一个.plt节,它是用于处理库调用的运行时解析的功能存根数组.

There is a .plt section created in the code segment, which is an array of function stubs used to handle the run-time resolution of library calls.

还有这里还有一点:

我要提及的下一部分是.plt部分.它包含我们在共享库中调用函数时使用的跳转表.默认情况下,链接器会初始化所有.plt条目,而不是指向正确的目标函数,而是指向动态加载器本身.因此,第一次调用任何给定的函数时,动态加载程序将查找该函数并修复.plt的目标,以便下次使用此.plt插槽时,我们将调用正确的函数.进行更改后,动态加载程序将调用函数本身.

The next section I want to mention is the .plt section. This contains the jump table that is used when we call functions in the shared library. By default the .plt entries are all initialized by the linker not to point to the correct target functions, but instead to point to the dynamic loader itself. Thus, the first time you call any given function, the dynamic loader looks up the function and fixes the target of the .plt so that the next time this .plt slot is used we call the correct function. After making this change, the dynamic loader calls the function itself.

在我看来,共享库的编译或组装方式存在问题.希望再搜索elf PLT部分使您走上正确的轨道.

Sounds to me like there's an issue with how the shared library was compiled or assembled. Hopefully a few more searches to elf PLT section gets you on the right track.

这篇关于sprof“未找到PLTREL错误";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆