[PATCH] Introduce ELF_INITFINI for all architectures
Florian Weimer
fweimer@redhat.com
Wed Aug 8 19:56:00 GMT 2018
On 08/08/2018 09:49 PM, Palmer Dabbelt wrote:
> On Wed, 08 Aug 2018 07:42:27 PDT (-0700), fweimer@redhat.com wrote:
>> On 06/23/2018 11:45 PM, Florian Weimer wrote:
>>> 2018-06-23Â Florian Weimer<fweimer@redhat.com>
>>>
>>> Â Â Â Â Introduce ELF_INITFINI, set everywhere except on RISC-V.
>>> Â Â Â Â * sysdeps/init_array/crti.S: Move to ...
>>>     * sysdepes/generic/crti.S: here. Report an error if ELF_INITFINI.
>>> Â Â Â Â * sysdeps/init_array/crtn.S: Move to ...
>>>     * sysdeps/generic/crtn.S: here. Report an error if ELF_INITFINI.
>>> Â Â Â Â * csu/elf-init.c: Check ELF_INITFINI instead of NO_INITFINI.
>>> Â Â Â Â * gmon/gmon-start.c [!ELF_INITFINI] (GMON_START_ARRAY_SECTION):
>>> Â Â Â Â Define.
>>> Â Â Â Â * elf/dl-fini.c (_dl_fini): Check for ELF_INITFINI before using
>>> Â Â Â Â DT_FINI.
>>> Â Â Â Â * elf/dl-init.c (call_init): Check for ELF_INITFINI before using
>>> Â Â Â Â DT_INIT.
>>> Â Â Â Â * nptl/pt-crti.S [ELF_INITFINI]: Use .init_array instead of
>>> Â Â Â Â PREINIT_FUNCTION.
>>> Â Â Â Â * sysdeps/generic/platform-params.h: New file.
>>> Â Â Â Â * sysdeps/init_array/elf-init.c: Remove file.
>>> Â Â Â Â * sysdeps/init_array/gmon-start.c: Likewise.
>>> Â Â Â Â * sysdeps/init_array/pt-crti.S: Likewise.
>>> Â Â Â Â * sysdeps/riscv/Implies (init_array): Remove.
>>> Â Â Â Â * sysdeps/riscv/platform-params.h: New file.
>>
>> Ping?
>>
>> Â Â <https://sourceware.org/ml/libc-alpha/2018-07/msg00051.html>
>
> I'm happy with the RISC-V aspects, which I understand to be functionally
> a NOP. I like avoiding the ABI bloat.
>
> For some reason I thought someone mentioned some references to
> _init/_fini floating around our port, but I can't find any so maybe I'm
> just going crazy? If they're there then we should probably remove them,
> as they don't actually do anything.
The patch removes the DT_INIT/DT_FINI execution logic from the RISC-V
port because ELF_INITFINI && l->l_info[DT_FINI] != NULL and the similar
condition for DT_INIT are always false. Before the patch, the code is
still there, but dormant because the GNU toolchain will always generate
NULL pointers there.
Thanks,
Florian
More information about the Libc-alpha
mailing list