
On Mon, 15 Mar 2021, Michael Matz wrote:
You could also link a live patchable library against libpulp (and so make any process using that library also be live patchable). But that has some interesting consequences about entry tracking: it starts globally for a process only when libpulp is loaded, so anything loaded before libpulp is loaded isn't tracked.
Hmm, perhaps this changed in the past, but since I joined the project, entrance tracking happens regardless of libpulp.so.0 being loaded or not. Entrance tracking is enabled on any library that has been made live-patchable, because the .dynsym section in them is tweaked (by ulp_post (formerly known as dynsym_gate)) so that the addresses of actual functions are replaced with the address of trampolines (added by ulp_post). Just for the sake of completeness, each function has its own trampoline, which stores the address of the actual target function on the stack, then jumps to the entrance tracking routine. By the way, this is the main source of overhead, so having a live-patchable library installed in default locations (or preferred by ld.so.cache) has an effect on the whole system. Perhaps this needs changing (in .spec files, that is).