Treat SHT_FINI_ARRAY and SHT_PREINIT_ARRAY as relocatable sections
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 30 Aug 2018 15:01:36 +0000 (08:01 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 30 Aug 2018 15:03:34 +0000 (08:03 -0700)
commit385e5b9039d12d3c2ab25023e827ee9a681c1aad
treed2ef56f5fae62535cf9ffaa5642bb44bdb56c9f6
parentfdad7678b74a170ead1ef967007be087435715f7
Treat SHT_FINI_ARRAY and SHT_PREINIT_ARRAY as relocatable sections

Since SHT_FINI_ARRAY and SHT_PREINIT_ARRAY sections are relocatable,
this patch fixes readelf and adds a testcase.

binutils/

* readelf.c (process_section_headers): Treat SHT_FINI_ARRAY and
SHT_PREINIT_ARRAY as relocatable sections.

gas/

* testsuite/gas/elf/elf.exp: Run section14.
* testsuite/gas/elf/section14.d: New file.
* testsuite/gas/elf/section14.s: Likewise.
binutils/ChangeLog
binutils/readelf.c
gas/ChangeLog
gas/testsuite/gas/elf/elf.exp
gas/testsuite/gas/elf/section14.d [new file with mode: 0644]
gas/testsuite/gas/elf/section14.s [new file with mode: 0644]