Is there any macro or pointer within ld.so which can give me address range of all the plt sections?

StackOverflow https://stackoverflow.com/questions/22124807

Question

I am modifying the libc6 dynamic linker. For a given program which is run and all the shared libraries which are loaded with it I need the address range(start address + length) of all the respective .plt sections.

Is there any macro or pointers within the linker ld.so code which I can use for this purpose? I am going through the linker code but due to lack of documentation in this perspective I am not able to figure out the exact element for my purpose. Google for it does not give any specific results which are useful for me.

Since linker does the initial loading and relocation it should have these information. Any suggestions are highly appreciated.

EDIT

Is there a way to get section headers through linker? I can use them to get the plt section information.

Thanks

No correct solution

OTHER TIPS

On Linux you probably want to use dl_iterate_phdr(3)

BTW, you should study the source code, and perhaps modify, MUSL libc; it is quite readable and has its own dynamic linker.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top