This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ld: Keep PREINIT_ARRAY/INIT_ARRAY/FINI_ARRAY sections for -r --gc-section
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 12 Jan 2018 18:40:03 +1030
- Subject: Re: [PATCH] ld: Keep PREINIT_ARRAY/INIT_ARRAY/FINI_ARRAY sections for -r --gc-section
- Authentication-results: sourceware.org; auth=none
- References: <20180111165714.GA7379@gmail.com>
On Thu, Jan 11, 2018 at 08:57:14AM -0800, H.J. Lu wrote:
> We must keep all PREINIT_ARRAY, INIT_ARRAY as well as FINI_ARRAY sections
> for ld -r --gc-section.
>
> OK for master?
>
> H.J.
> ---
> bfd/
>
> PR ld/22677
> * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
> INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section.
I'm wondering why we need this part
> + ${RELOCATING+${PREINIT_ARRAY}}
> ${RELOCATING+${INIT_ARRAY}}
> ${RELOCATING+${FINI_ARRAY}}
given that if these were not wrapped in ${RELOCATING+} it seems like
KEEP in the script ought to be good enough?
--
Alan Modra
Australia Development Lab, IBM