linux - sprof "PLTREL not found error"

标签 linux sprof

我正在尝试分析我们的共享库,但每当我设置环境变量 LD_PROFILE 时,我都会收到“PLTREL not found in object”。是什么赋予了?我缺少某种链接器标志还是什么?互联网上似乎没有关于此的信息。 sprof 的手册页大约有 10 个词长。

最佳答案

根据 an unanswered question on Google Groups ,看来您不是第一个遇到此问题的人。

我认为 pltrel 的意思是 plt-relative;在一些ELF design notes ,

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.

here还有一点:

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.

在我看来,共享库的编译或组装方式存在问题。希望还有更多searches to elf PLT section让您走上正确的轨道。

关于linux - sprof "PLTREL not found error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1240384/

相关文章:

linux - Bash脚本,如果语句

linux - 如果未找到,则打印 "#include"或整个文件 Linux 命令行

linux - 这些导出变量的默认值是什么?

c - gprof : How to generate call graph for functions in shared library that is linked to main program

linux - 使用AT&T语法将整数打印为字符串,并使用Linux系统调用而不是printf

linux - Git需要用户名和密码进行git push,git pull使用HTTPS方式

linux - 将 "ls"从 emacs dired 更改为其他应用程序