[RESEND PATCH] Makeconfig: Set pie-ccflag to -fPIE by default

H.J. Lu hjl.tools@gmail.com
Mon Aug 29 19:43:34 GMT 2022


On Mon, Aug 29, 2022 at 8:27 AM Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>
> 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).
>

But -static isn't passed to cc1.


-- 
H.J.


More information about the Libc-alpha mailing list