[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array
From: |
nickc at redhat dot com |
Subject: |
[Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array |
Date: |
Thu, 11 Jan 2018 17:02:37 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22677
--- Comment #4 from Nick Clifton <nickc at redhat dot com> ---
Created attachment 10728
--> https://sourceware.org/bugzilla/attachment.cgi?id=10728&action=edit
Proposed patch
Hi David,
Sorry - I missed the "-r" option in your initial bug report.
This does pose an interesting problem however as your linker script
fragment is only a partial solution. The .init_array and .fini_array
sections can have a priority value as a suffix to their name, and this
suffix must be preserved when linking with -r. (See
ld/testsuite/ld-elf/init-fini-arrays.[sd] for an example of this). Hence
using:
.init_array { KEEP (.init_array.*) }
will not work as it looses the section suffixes. So instead I am proposing
the attached patch which adds a special case for init and fini arrays to
the garbage collection code in the BFD library. Please could you try it
out and let me know if it works for you.
Cheers
Nick
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/22677] New: ld -r --gc-collect does not KEEP .init_array/.fini_array, address@hidden, 2018/01/05
- [Bug ld/22677] ld -r --gc-collect does not KEEP .init_array/.fini_array, address@hidden, 2018/01/05
- [Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array, address@hidden, 2018/01/05
- [Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array, nickc at redhat dot com, 2018/01/08
- [Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array, address@hidden, 2018/01/10
- [Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array,
nickc at redhat dot com <=
- [Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array, cvs-commit at gcc dot gnu.org, 2018/01/11
- [Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array, hjl.tools at gmail dot com, 2018/01/11
- [Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array, address@hidden, 2018/01/11