This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] aarch64: Check PIC instead of SHARED in start.S
On 10/3/17, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> On 03/10/17 13:00, H.J. Lu wrote:
>> On 10/3/17, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>>> ok, this works (for binaries < 4G), but i assumed the symbols
>>> can come from external module (in case of non-static linking)
>>> and thus crt1.o will need GOT entries anyway, but now i see
>>> that all of __libc_csu_init, __libc_csu_fini and main will
>>> be in the same module as crt1.o
>>>
>>> i can update start.S, but i wonder if there might be code
>>> where main is not in the executable for some reason, but
>>> comes from a shared lib.
>>>
>>
>> That won't happen with static PIE :-).
>>
>
> yes but now crt1.o is used for both static and non-static
> linking and if i change start.S it will observably change
> abi for the non-static case (i think it probably does not
> matter in practice, but somebody might think otherwise).
>
Can you modify your start.S with
#if defined PIC && !defined SHARED
pass local_main to __libc_start_main
local_main:
tail call to main via PLT
--
H.J.