[PATCH] Introduce <elf-initfini.h> and ELF_INITFINI for all architectures

Florian Weimer fweimer@redhat.com
Tue Feb 18 14:13:00 GMT 2020


* Adhemerval Zanella:

> On 20/12/2019 11:23, Florian Weimer wrote:
>> This change is desirable for a rework of the statically linked startup
>> code to remove the generic ROP trampoline in it (bug 23323).
>> 
>> I verified that the *crt*.o files are unchanged by this change after
>> stripping (although my binutils dispatcher fails to determine the
>> correct ABI for some of the MIPS gcrt1.o files, so those have not been
>> checked).
>> 
>> Thanks,
>> Florian
>> 8<------------------------------------------------------------------8<
>> 
>> This supersedes the init_array sysdeps directory.  It allows us to
>> check for ELF_INITFINI in both C and assembler code, and skip DT_INIT
>> and DT_FINI processing completely on newer architectures.
>> 
>> A new header file is needed because <dl-machine.h> is incompatible
>> with assembler code.  <sysdep.h> is compatible with assembler code,
>> but it cannot be included in all assembler files because on some
>> architectures, it redefines register names, and some assembler files
>> conflict with that.
>> 
>> <elf-initfini.h> is replicated for legacy architectures which need
>> DT_INIT/DT_FINI support.  New architectures follow the generic default
>> and disable it.
>
> LGTM, with only a small clarification below.
>
> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

I've fixed up the years and URLs and pushed this.

Thanks,
Florian



More information about the Libc-alpha mailing list