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

Wilco Dijkstra Wilco.Dijkstra@arm.com
Fri Aug 26 18:39:14 GMT 2022


Hi,

>> I recall that powerpc wanted to use -mcmodel=large, but it would require to
>> adjust a lot of assembly implementations.  Are we sure this change does not
>> trigger any regression with current glibc code?

I don't see significant differences in terms of codesize on AArch64, so the patch
is fine. As Richard mentioned, it often doesn't make any difference if a function
only uses a single global.

However this exposes a bug: it appears all symbols, including hidden symbols,
are always accessed via the GOT in libc.a even when they don't in libc.so. As a
result PIE code quality is actually worse than PIC... This affects libc_single_threaded
and many uses of internal arrays etc.

So it looks like we should not ignore hidden when building for PIE.

Cheers,
Wilco


More information about the Libc-alpha mailing list