2009-08-06 110 views
1

我試圖描述我們的共享庫,但每當我有環境變量LD_PROFILE設置,我就會收到「在對象中找不到PLTREL」。是什麼賦予了?是否有某種鏈接器標誌我失蹤或什麼?在互聯網上似乎沒有關於這方面的信息。 sprof的手冊頁長約10個字。sprof「PLTREL未找到錯誤」

回答

1

根據an unanswered question on Google Groups,看起來你並不是第一個有這個問題的人。

我認爲pltrel的意思是plt-rel ative;在一些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讓你走上正軌。

0

發現this可以relevante你:

Known issues with LD_AUDIT

➢ LD_AUDIT does not work with Shared Libraries with no code in them.

➢ Example ICU-4.0 「libicudata.so」

➢ Error: 「no PLTREL found in object /usr/lib/libicudata.so.40」

➢ Recompile after patching libicudata by sed'ing -nostdlib etc away sed -i -- "s/-nodefaultlibs -nostdlib//" config/mh-linux

似乎同樣適用於LD_PROFILE