[PATCH v2 4/4] powerpc64: Enable static-pie

Fangrui Song maskray@google.com
Thu Apr 14 03:42:32 GMT 2022


On 2022-04-14, Alan Modra via Libc-alpha wrote:
>On Fri, Apr 08, 2022 at 07:49:05PM -0300, Tulio Magno Quites Machado Filho wrote:
>> Alan Modra via Libc-alpha <libc-alpha@sourceware.org> writes:
>>
>> > 	* sysdeps/powerpc/powerpc64/configure.ac (SUPPORT_STATIC_PIE): Define.
>> > 	(PI_STATIC_AND_HIDDEN): Define.
>> > 	* sysdeps/powerpc/powerpc64/configure: Regenerate.
>>
>> While the code in this patch is perfect, I'm slightly inclined to think its
>> merge should be delayed until the failures on both powerpc64-linux and
>> powerpc64le-linux are fixed.
>>
>> Another option would be to restrict this code to powerpc64le-linux only,
>> although I haven't had the success you mentioned in the cover letter.
>>
>> Anyway, in one of my tests in particular (powerpc64le-linux, GCC 8, Binutils
>> 2.30, without --enable-static-pie) I noticed many tests failing.  I'm still
>> investigating what happened.
>
>binutils-2.30 is too old.  You'll find __rela_iplt_start and
>__rela_iplt_end symbols being defined in PIEs.  Those symbols are
>supposed to mark out IFUNC relocs in ET_EXEC static binaries.  Their
>presence in ET_DYN static binaries is bad, especially since it seems
>they have garbage values not pointing at the correct set of
>relocations.  I suspect, but haven't checked, that the garbage values
>are due to -z combreloc.  This bug in ld was fixed with commit
>795e3bb7de9, so you'll need at least binutils-2.33 for static-pie.

I think conditional definition of __rela_iplt_start depending on
-no-pie/-pie is inelegant: it makes __rela_iplt_start the only symbol
with -no-pie/-pie internal linker script difference.
-no-pie/-pie internal linker scripts could otherwise be very similar,
with just the image base difference.


More information about the Libc-alpha mailing list