Why is _dl_relocate_static_pie linked into crt1.o?

Florian Weimer fweimer@redhat.com
Thu Jul 5 12:14:00 GMT 2018


On 07/05/2018 02:09 PM, Andreas Schwab wrote:
> On Jul 05 2018, Florian Weimer <fweimer@redhat.com> wrote:
> 
>> I see this:
>>
>> “
>> $ objdump -d --reloc /usr/lib64/crt1.o
> 
> crt1.o is only used by non-PIE executables, isn't it?

Yes, _start does not even perform the required relocations.

I assume the intent here is that other code can be shared between PIE 
and non-PIE executables.  However, it's not clear to me why the symbol 
_dl_relocate_static_pie has to be used in the address calculation.  If 
there's another symbol which is present in shared and static-PIE builds 
alike, wouldn't that avoid the need for defining _dl_relocate_static_pie 
in shared builds?

Thanks,
Florian



More information about the Libc-alpha mailing list