This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] aarch64: Check PIC instead of SHARED in start.S


On 03/10/17 11:39, Szabolcs Nagy wrote:
> On 02/10/17 12:20, H.J. Lu wrote:
>> On 10/2/17, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>>> On 29/09/17 22:32, H.J. Lu wrote:
>>>> Since start.o may be compiled as PIC, we should check PIC instead of
>>>> SHARED.
>>>>
>>>> OK for master?
>>>>
>>>
>>> i believe that the compile/link tests worked..
>>
>> Does static PIE of hjl/pie/static branch run on arm and aarch64?
>>
> 
> no, if i build with --enable-static-pie the install step
> fails when the static linked sln runs.
> 
> there are relative relocs against the func ptrs that are
> loaded from GOT in the startup code, but execution fails
> even before those are used because there are R*_JUMP_SLOT
> and R*_GLOB_DAT relocs which are not processed correctly.
> 
> in particular in
>   if (__pthread_initialize_minimal != NULL)
>     __pthread_initialize_minimal ();
> the symbol value loaded from GOT is non-NULL even though
> there is no pthread linked in, that is probably a linker bug.
> 

it seems weak extern symbol is accessed via got and at
link time that is not relaxed to 0 with -static -pie
and the got entry is not initialized to 0 either.

as far as i can see the startup code and weak symbols
are the remaining issues on aarch64 for static pie.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]