Re: (interposers): How to workaround the "strong symbols" problem?

Liste des GroupesRevenir à cu programmer 
Sujet : Re: (interposers): How to workaround the "strong symbols" problem?
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.unix.programmer
Date : 18. Jan 2025, 01:42:35
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <vmetdr$341gl$1@news.xmission.com>
References : 1 2
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <wwved112g19.fsf@LkoBDZeT.terraraq.uk>,
Richard Kettlewell  <invalid@invalid.invalid> wrote:
...
Generally, it all works fine - or at least, it did - until they
started having "strong symbols" (I think that's the right term).
>
I think you mean STB_WEAK vs STB_GLOBAL, in the naming used in Glibc and
the ELF spec.

Maybe so.  I am not familiar with these terms.  Could you explain further?

Anyway, and FWIW, I think it turns out this is not relevant to my problem
(see below).

...

I can interpose both weak and global symbols from Debians Glibc 2.39
without doing anything unusual.

Good to hear.  So, does this (weak vs. global) have any connection at all
to whether or not you can interpose them?

...

Yes, it can be done.
...
Something that tripped me up: a program shows a call to openat() in
strace output, so one tries to interpose openat(). But in fact the
program is calling the Glibc open() function, which calls the openat()
syscall.
...
However I think from your other post that you've already considered this
possibility.

Right.  It seems to boil down to:

    You can't interpose a syscall.

I.e., so if a library function calls the syscall directly (rather than
going through the Glibc wrapper), you can't interpose it.  This is, of
course, as it should be.

Anyway, I got it working (so this thread can be considered solved) and I
think you gave me a push in the right direction.  It turns out the function
I have to hook is "fopen64".  I figured this out by using "ltrace" rather
than "strace".  It turns out "strace" is too low-level.

So, thanks for your post.

--
When someone tells me he/she is a Christian I check to see if I'm
still in possession of my wallet.

Date Sujet#  Auteur
17 Jan 25 * (interposers): How to workaround the "strong symbols" problem?16Kenny McCormack
17 Jan 25 +* Re: (interposers): How to workaround the "strong symbols" problem?2Kenny McCormack
18 Jan 25 i`- Re: (interposers): How to workaround the "strong symbols" problem?1Kaz Kylheku
18 Jan 25 `* Re: (interposers): How to workaround the "strong symbols" problem?13Richard Kettlewell
18 Jan 25  `* Re: (interposers): How to workaround the "strong symbols" problem?12Kenny McCormack
19 Jan 25   `* Re: (interposers): How to workaround the "strong symbols" problem?11Marcel Mueller
19 Jan 25    `* Re: (interposers): How to workaround the "strong symbols" problem?10Richard Kettlewell
19 Jan 25     +* Re: (interposers): How to workaround the "strong symbols" problem?5Kenny McCormack
19 Jan 25     i`* Re: (interposers): How to workaround the "strong symbols" problem?4Marcel Mueller
19 Jan 25     i +* Re: (interposers): How to workaround the "strong symbols" problem?2Kenny McCormack
20 Jan 25     i i`- Re: (interposers): How to workaround the "strong symbols" problem?1Marcel Mueller
20 Jan 25     i `- Re: (interposers): How to workaround the "strong symbols" problem?1Richard Kettlewell
20 Jan 25     `* Re: (interposers): How to workaround the "strong symbols" problem?4Muttley
20 Jan 25      `* Re: (interposers): How to workaround the "strong symbols" problem?3Kalevi Kolttonen
20 Jan 25       `* Re: (interposers): How to workaround the "strong symbols" problem?2Kenny McCormack
20 Jan 25        `- Re: (interposers): How to workaround the "strong symbols" problem?1Kaz Kylheku

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal