public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: Cary Coutant <ccoutant@gmail.com>
To: Nick Clifton <nickc@redhat.com>
Cc: gnu-gabi@sourceware.org, "H.J. Lu" <hjl.tools@gmail.com>,
		Florian Weimer <fweimer@redhat.com>
Subject: Re: RFA: Add a new gynamic tag: DT_GNU_GOT_PLT_END
Date: Mon, 01 Jan 2018 00:00:00 -0000	[thread overview]
Message-ID: <CAJimCsFZMEEfDR=gFEqrvbj5T2p=_EQ2D-4Wu-HXqWpH1uY-oA@mail.gmail.com> (raw)
In-Reply-To: <83d583d0-884e-4208-436e-5b25cbb6ce5a@redhat.com>

>   I would like to propose the addition of a new dynamic tag to the gABI:
>
> #define DT_GNU_GOT_PLT_END 0x60000100
>
>   This tag would have two effects:
>
>     * Its presence in the dynamic section would indicate that the
>       .got.plt section is on its own in a page aligned region of
>       memory.
>
>   IE no other sections overlap the pages used by the .got.plt, and
>   the section has been padded so that it ends on a page alignment
>   boundary.
>
>     * The value of the tag would give the address of the first
>       byte beyond the end of the .got.plt.
>
>   This means that the size of the .got.plt can be computed by
>   subtracting the value of the DT_PLTGOT tag from the DT_GNU_GOT_PLT_END
>   tag.
>
>   The practical use of this tag is to allow the dynamic linker to
>   isolate the .got.plt section by changing the permissions on the pages
>   that it occupies.

First: If you're proposing this for the gABI, you should drop the
"GNU_" from the name. Or are you really proposing this just for the
Gnu ABI?

Second: Spelling. If the other related tag is DT_PLTGOT, let's spell
this one similarly -- DT_PLTGOT_END.

Third: Adding an "end of section" address is unusual for the dynamic
table. You've been quite explicit to say "the address of the first
byte beyond the end of the .got.plt", but it's actually much less
error prone to give the size of the section rather than its ending
address. You could have DT_PLTGOTSZ, which would parallel other
dynamic tags.

Fourth: Isn't the size of .got.plt inferrable from DT_PLTRELSZ? Divide
that by the size of each relocation (DT_PLTREL == DT_REL ? DT_RELENT :
DT_RELAENT), then multiply by the size of the PLTGOT entry (4 or 8),
then add the three reserved entries. There's a one-to-one relationship
between the PLT and the PLTGOT, and every PLTGOT entry must have a
relocation.

Fifth: If all you're trying to say is "the .got.plt section is
isolated on its own pages", couldn't you just use one of the DT_FLAGS
or DT_FLAGS_1? Letting the presence of an END or SZ entry signal this
condition is a bit risky -- what if someone decides they'd like to
record the size of .got.plt even when it's not isolated on its own
pages?

-cary

  reply	other threads:[~2018-06-22 21:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87sh5hadd6.fsf@redhat.com>
     [not found] ` <CAMe9rOrFiHvUj4EeviT8UdA2b8b_FpiPofeNqRyWzNA9286ZNQ@mail.gmail.com>
2018-01-01  0:00   ` Nick Clifton
2018-01-01  0:00     ` Cary Coutant [this message]
2018-01-01  0:00       ` Cary Coutant
2018-01-01  0:00       ` Florian Weimer
2018-01-01  0:00         ` Cary Coutant
2018-01-01  0:00           ` Florian Weimer
2018-01-01  0:00             ` Cary Coutant
2018-01-01  0:00               ` Florian Weimer
2018-01-01  0:00                 ` Cary Coutant
2018-01-01  0:00                   ` Florian Weimer

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='CAJimCsFZMEEfDR=gFEqrvbj5T2p=_EQ2D-4Wu-HXqWpH1uY-oA@mail.gmail.com' \
    --to=ccoutant@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=gnu-gabi@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=nickc@redhat.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).