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: Why is _dl_relocate_static_pie linked into crt1.o?


On 07/05/2018 09:37 AM, Szabolcs Nagy wrote:
> 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

Florian's question was "Why is?" and we've answered that.

Do we need to do anything else?

Leaving the changes in has marginal value to help developers
finish the static pie support.

-- 
Cheers,
Carlos.


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