|
|
Subscribe / Log in / New account

Interposers and rewriting the Procedure Linkage Table (PLT) o

Interposers and rewriting the Procedure Linkage Table (PLT) o

Posted Feb 8, 2024 0:40 UTC (Thu) by davecb (subscriber, #1574)
Parent article: GNU C Library version 2.39

In a previous life, I merrily interposed my functions between callers and libraries with LD_PRELOAD. For example, I built a library profiler that way (https://github.com/davecb/libprof/blob/master/libprof.1)

I'm rather hoping that the rewrite of the PLT to use absolute jumps to the correct location on startup honours LD_PRELOAD=./libprof.so.1 <program>, which is available on startup.


to post comments

Interposers and rewriting the Procedure Linkage Table (PLT) o

Posted Feb 8, 2024 1:26 UTC (Thu) by jrtc27 (subscriber, #107748) [Link] (2 responses)

It does not change symbol preemption rules, only what happens once it's figured out what the symbol is.

Interposers and rewriting the Procedure Linkage Table (PLT) o

Posted Feb 8, 2024 9:57 UTC (Thu) by Wol (subscriber, #4433) [Link]

Sounds a bit like the Pr1me linker from the 80s! I don't remember the details, but when a subroutine was called for the first time it went through a handler that replaced the caller site with a direct jump. That feels like I'm describing Unix ld as well ...

I feel like I'm stating the obvious here - probably missed something important :-)

Cheers,
Wol

Interposers and rewriting the Procedure Linkage Table (PLT) o

Posted Feb 8, 2024 12:59 UTC (Thu) by davecb (subscriber, #1574) [Link]

Super, thanks!


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds