From: Cary Coutant <ccoutant@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Generic System V Application Binary Interface
<generic-abi@googlegroups.com>, Florian Weimer <fw@deneb.enyo.de>,
gnu-gabi@sourceware.org
Subject: Re: RFC: Audit external function called indirectly via GOT
Date: Mon, 01 Jan 2018 00:00:00 -0000 [thread overview]
Message-ID: <CAJimCsHnHiZxzhyyy-AZvRJsSM8S2toUfvpw=VUtj8Yy4hzWNA@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOrCb37F4YEm7nXRsiFWf+sqiJ1NR=sUiT_R-Uox2S-e8A@mail.gmail.com>
>>> My suggestion was that the GOT entry could be statically initialized
>>> by the linker to point to the provisional PLT entry, rather than
>>> forcing the dynamic loader to go through all this messy computation.
>>> If auditing is not enabled, it would process the GLOB_DAT relocation
>>> normally, and set the GOT entry to point to the actual function,
>>> bypassing the provisional PLT and PLTGOT entries completely. If
>>> auditing is enabled, it could simply ignore the GLOB_DAT relocation
>>> (or, if the binary is PIE, it could process it as a RELATIVE
>>> relocation), and the -fno-plt calls will end up jumping to the
>>> provisional PLT entry.
>>>
>>> (This is already how we handle the PLTGOT entries: the linker
>>> statically initializes the entries to point to part (b)* of the PLT
>>> entry, while putting JUMP_SLOT relocations for those entries into the
>>> JMPREL table.)
>>>
>>> I think if you do that, none of these extra dynamic table entries will
>>> be needed, ...
>
> Your scheme is very similar to mine. Both generate one GLOB_DAT
> and one JUMP_SLOT relocation for the same function symbol. But
> only one of them should be used at run-time. Your scheme may be
> simpler when LD_AUDIT is used since you don't need to update GOT
> slot. But you still need to decide if a GLOB_DAT relocation should be
> skipped for LD_AUDIT.
That's why I then suggested this:
> I suppose you may also want to partition the GLOB_DAT relocations, so
> that the dynamic loader can easily figure out which ones to ignore
> when auditing is enabled. That would take another dynamic table entry.
-cary
next prev parent reply other threads:[~2018-03-28 4:11 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-01 0:00 H.J. Lu
2018-01-01 0:00 ` Florian Weimer
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Florian Weimer
2018-01-01 0:00 ` Carlos O'Donell
2018-01-01 0:00 ` Florian Weimer
2018-01-01 0:00 ` Carlos O'Donell
2018-01-01 0:00 ` Florian Weimer
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Florian Weimer
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Carlos O'Donell
2018-01-01 0:00 ` Cary Coutant
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Cary Coutant
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Cary Coutant [this message]
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Florian Weimer
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Florian Weimer
2018-01-01 0:00 ` Cary Coutant
2018-01-01 0:00 ` Carlos O'Donell
2018-01-01 0:00 ` Cary Coutant
2018-01-01 0:00 ` Alan Modra
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Alan Modra
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Cary Coutant
2018-01-01 0:00 ` H.J. Lu
2018-01-01 0:00 ` Cary Coutant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJimCsHnHiZxzhyyy-AZvRJsSM8S2toUfvpw=VUtj8Yy4hzWNA@mail.gmail.com' \
--to=ccoutant@gmail.com \
--cc=fw@deneb.enyo.de \
--cc=generic-abi@googlegroups.com \
--cc=gnu-gabi@sourceware.org \
--cc=hjl.tools@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).