public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Fangrui Song <i@maskray.me>
To: Jan Beulich <jbeulich@suse.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>, binutils@sourceware.org
Subject: Re: [PATCH v2] x86-64: Add -z mark-plt and -z nomark-plt
Date: Thu, 28 Sep 2023 00:02:35 -0700	[thread overview]
Message-ID: <DS7PR12MB57655DA288EEE2E036350BFDCBC1A@DS7PR12MB5765.namprd12.prod.outlook.com> (raw)
In-Reply-To: <e45dff22-855b-1d52-cf4e-e5fad4c6f146@suse.com>

On Wed, Sep 27, 2023 at 11:07 PM Jan Beulich via Binutils
<binutils@sourceware.org> wrote:
>
> On 27.09.2023 19:19, H.J. Lu via Binutils wrote:
> > --- a/ld/ld.texi
> > +++ b/ld/ld.texi
> > @@ -1475,6 +1475,11 @@ Specify that the object's filters be processed immediately at runtime.
> >  @item max-page-size=@var{value}
> >  Set the maximum memory page size supported to @var{value}.
> >
> > +@item mark-plt
> > +@itemx nomark-plt
> > +Mark PLT entries with dynamic tags, DT_X86_64_PLT, DT_X86_64_PLTSZ and
> > +DT_X86_64_PLTENT.  Supported for x86_64.
>
> Hmm, you use backwards compatibility issues as justification for not having
> a configure time way to default the new behavior to enabled, and then you
> don't mention the backwards compatibility aspect here?
>
> Jan

For linker defaults, they can be performed either on the linker side
or on the compiler driver side.
If GCC specifies an extra option to ld (like -z relro -z now), I think
it is fine for ld not to have a configure-time option.
(I understand that someone may argue that patching ld has a greater
coverage... I typically refute such arguments. This mark-plt is for a
rtld optimization that unlikely applies to the programs that directly
use ld anyway.)

At least for LLD that I maintain, we prefer not to have
target-specific differences and prefer that the compiler drivers pass
relevant options to the linker.
Linker not having to deal with too many defaults allows testing more
address-related properties in the output, which I find valuable to
catch many bugs without doing distribution testing.
(https://sourceware.org/bugzilla/show_bug.cgi?id=28602)

  reply	other threads:[~2023-09-28  7:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27 17:19 H.J. Lu
2023-09-28  6:00 ` Jan Beulich
2023-09-28  6:07 ` Jan Beulich
2023-09-28  7:02   ` Fangrui Song [this message]
2023-09-28 14:52   ` H.J. Lu
2023-09-28 14:54     ` Jan Beulich

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=DS7PR12MB57655DA288EEE2E036350BFDCBC1A@DS7PR12MB5765.namprd12.prod.outlook.com \
    --to=i@maskray.me \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=jbeulich@suse.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).