Why is _dl_relocate_static_pie linked into crt1.o?
Szabolcs Nagy
szabolcs.nagy@arm.com
Thu Jul 5 13:37:00 GMT 2018
On 05/07/18 13:37, H.J. Lu wrote:
> On Thu, Jul 5, 2018 at 5:34 AM, Florian Weimer <fweimer@redhat.com> wrote:
>> On 07/05/2018 02:24 PM, Andreas Schwab wrote:
>>>
>>> On Jul 05 2018, Florian Weimer <fweimer@redhat.com> wrote:
>>>
>>>> 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.
>>>
>>>
>>> Which address calculation?
>>
>>
>> This code in sysdeps/m68k/dl-machine.h (arm has something similar):
>>
>> /* Return the run-time load address of the shared object. */
>> static inline Elf32_Addr
>> elf_machine_load_address (void)
>> {
>> Elf32_Addr addr;
>> #ifdef SHARED
>> asm (PCREL_OP ("lea", "_dl_start", "%0", "%0", "%%pc") "\n\t"
>> "sub.l _dl_start@GOT.w(%%a5), %0"
>> : "=a" (addr));
>> #else
>> asm (PCREL_OP ("lea", "_dl_relocate_static_pie", "%0", "%0", "%%pc")
>> "\n\t"
>> "sub.l _dl_relocate_static_pie@GOT.w(%%a5), %0"
>> : "=a" (addr));
>> #endif
>> return addr;
>> }
>
> Can we fix m68k and arm?
>
do they support --enable-static-pie? if not then i'd just revert
9ba7e81028b3313d9aeb97a98d2e37626694d442
and
c34a19ed4b0bcf91ff9671b733f8cfffa111e7f6
8172aad937f52fe4ae891a206492150815791f2a
patches.
More information about the Libc-alpha
mailing list