[PATCH] arm: Enable static-pie support (BZ 34098)

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Tue Jun 2 16:38:55 GMT 2026



On 02/06/26 11:37, Andreas Schwab wrote:
> On Apr 24 2026, Adhemerval Zanella wrote:
> 
>> It requires proper gcc support [1], and without proper compiler support
>> the arm configure disable static-pie support.
>>
>> The start.S requires some adjustment to avoid loading main from
>> the GOT.
>>
>> Checked on arm-linux-gnueabihf with and without the gcc patch applied.
> 
> This breaks the arm-main-in-dso test in mold, since it changes the
> relocation for main from R_ARM_GOT32 to R_ARM_REL32, and mold does not
> generate a PLT for the latter.
> 

I recall I first followed aarch64 strategy to use __wrap_main for
PIC && !SHARED, but the one I used ended in a simpler implementation.
It seems that wrap one should be safe for different linkers.


More information about the Libc-alpha mailing list