aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-08-30 08:01:36 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-08-30 08:03:34 -0700
commit385e5b9039d12d3c2ab25023e827ee9a681c1aad (patch)
treed2ef56f5fae62535cf9ffaa5642bb44bdb56c9f6 /binutils
parentfdad7678b74a170ead1ef967007be087435715f7 (diff)
downloadgdb-385e5b9039d12d3c2ab25023e827ee9a681c1aad.zip
gdb-385e5b9039d12d3c2ab25023e827ee9a681c1aad.tar.gz
gdb-385e5b9039d12d3c2ab25023e827ee9a681c1aad.tar.bz2
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.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 6b036db..a3d1354 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2018-08-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * readelf.c (process_section_headers): Treat SHT_FINI_ARRAY and
+ SHT_PREINIT_ARRAY as relocatable sections.
+
2018-08-30 Chenghua Xu <paul.hua.gm@gmail.com>
* MAINTAINERS: Add myself as a MIPS port maintainer.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 194f1c3..9c675dd 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -6359,6 +6359,8 @@ process_section_headers (Filedata * filedata)
&& filedata->section_headers[section->sh_info].sh_type != SHT_NOBITS
&& filedata->section_headers[section->sh_info].sh_type != SHT_NOTE
&& filedata->section_headers[section->sh_info].sh_type != SHT_INIT_ARRAY
+ && filedata->section_headers[section->sh_info].sh_type != SHT_FINI_ARRAY
+ && filedata->section_headers[section->sh_info].sh_type != SHT_PREINIT_ARRAY
/* FIXME: Are other section types valid ? */
&& filedata->section_headers[section->sh_info].sh_type < SHT_LOOS))
{