Sujet : (interposers): How to workaround the "strong symbols" problem?
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.unix.programmerDate : 17. Jan 2025, 22:33:45
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <vmeibp$33sam$1@news.xmission.com>
User-Agent : trn 4.0-test77 (Sep 1, 2010)
Context is Linux (and only Linux).
Over the years, I have written many "interposers" - that is, a shared
library loaded with LD_PRELOAD that hooks some system or library call
(e.g., "read"). The interposer usually ends up calling the "real"
function, then doing something special either before or after the call.
Generally, it all works fine - or at least, it did - until they started
having "strong symbols" (I think that's the right term). Anyway, some
number of years back, I noticed that it became kind of hit and miss as to
whether or not you could get your hooked version of the function to be
called. Generally, it seemed, the more "low level" the function, the less
likely it was that the interposer would work.
So, I am wondering, is there a fix for this? I'm assuming that somebody
decided that interposers were evil and thus, they came up with this as a
way to foil us, but there should be fix to the fix, so to speak. Is there?
Note: I am not showing code at the moment, because I'd like (if possible) a
simple "Yes, it can be done" or "No, they got you" type answer. If there
is sufficient interest, I can post code in a followup.
--
Marshall: 10/22/51
Jessica: 4/4/79