public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: Florian Weimer <fweimer@redhat.com>,
	Wilco Dijkstra via Libc-alpha <libc-alpha@sourceware.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [RESEND PATCH] Makeconfig: Set pie-ccflag to -fPIE by default
Date: Mon, 29 Aug 2022 15:27:36 +0000	[thread overview]
Message-ID: <AS4PR08MB7901F6D180527AC29A0A57DB83769@AS4PR08MB7901.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <87pmgj2o1d.fsf@oldenburg.str.redhat.com>

Hi Florian,

* Wilco Dijkstra via Libc-alpha:
>> However this leads to the question is why aren't all symbols marked as
>> hidden in the static PIE build? Ie. are there any symbols that must be
>> shared with a DSO loaded by a dl_open?
>
> The static main executable does not have a dynamic symbol table, so such
> sharing cannot happen (except through function pointers being passed
> around, but symbol visibility of course does not matter there).

Right, so it should be safe then to mark all symbols as hidden.

We could also teach GCC to never emit GOT indirections with -fPIE -static
(the only reason to use a GOT indirection is to avoid copy relocations in
dynamically linked binaries).

Cheers,
Wilco

WARNING: multiple messages have this Message-ID
From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: Florian Weimer <fweimer@redhat.com>,
	Wilco Dijkstra via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [RESEND PATCH] Makeconfig: Set pie-ccflag to -fPIE by default
Date: Mon, 29 Aug 2022 15:27:36 +0000	[thread overview]
Message-ID: <AS4PR08MB7901F6D180527AC29A0A57DB83769@AS4PR08MB7901.eurprd08.prod.outlook.com> (raw)
Message-ID: <20220829152736.d9YS8PYyzObCSSPJe6YDOKAkiFExsI7IcS5W48md988@z> (raw)
In-Reply-To: <87pmgj2o1d.fsf@oldenburg.str.redhat.com>

Hi Florian,

* Wilco Dijkstra via Libc-alpha:
>> However this leads to the question is why aren't all symbols marked as
>> hidden in the static PIE build? Ie. are there any symbols that must be
>> shared with a DSO loaded by a dl_open?
>
> The static main executable does not have a dynamic symbol table, so such
> sharing cannot happen (except through function pointers being passed
> around, but symbol visibility of course does not matter there).

Right, so it should be safe then to mark all symbols as hidden.

We could also teach GCC to never emit GOT indirections with -fPIE -static
(the only reason to use a GOT indirection is to avoid copy relocations in
dynamically linked binaries).

Cheers,
Wilco

  reply	other threads:[~2022-08-29 15:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 18:39 Wilco Dijkstra
2022-08-26 19:02 ` H.J. Lu
2022-08-26 19:45   ` Richard Henderson
2022-08-26 20:11     ` H.J. Lu
2022-08-29 11:49       ` Wilco Dijkstra
2022-08-29 13:10         ` Florian Weimer
2022-08-29 15:27           ` Wilco Dijkstra [this message]
2022-08-29 15:27             ` Wilco Dijkstra
2022-08-29 19:43             ` H.J. Lu
2022-08-29 19:57               ` Fangrui Song
2022-09-05  8:58                 ` Wilco Dijkstra
2022-09-15 21:45                   ` Fangrui Song
2022-09-20 13:59                     ` Wilco Dijkstra
2022-09-20 14:12                       ` Florian Weimer
2022-09-20 16:00                         ` Wilco Dijkstra
2022-09-20 22:02                           ` Fangrui Song
  -- strict thread matches above, loose matches on Subject: below --
2022-08-25 21:01 Richard Henderson
2022-08-26 12:32 ` Adhemerval Zanella Netto
2022-08-26 17:29   ` Richard Henderson

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=AS4PR08MB7901F6D180527AC29A0A57DB83769@AS4PR08MB7901.eurprd08.prod.outlook.com \
    --to=wilco.dijkstra@arm.com \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=richard.henderson@linaro.org \
    /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).