aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-05-20 00:33:42 +0930
committerAlan Modra <amodra@gmail.com>2016-05-20 00:35:24 +0930
commit606851fbf66c4a9e47c958014579dd363a74ba76 (patch)
tree2dd677bbe2e2c44a9525d3c61ba3a4b4fb0bda5b /bfd
parentbfb0d950a58edc4eb1f102174af38a364f4f43f7 (diff)
downloadgdb-606851fbf66c4a9e47c958014579dd363a74ba76.zip
gdb-606851fbf66c4a9e47c958014579dd363a74ba76.tar.gz
gdb-606851fbf66c4a9e47c958014579dd363a74ba76.tar.bz2
Set sh_entsize for .init_array and similar.
PR gas/20118 * elf.c (elf_fake_sections): Set sh_entsize for SHT_INIT_ARRAY, SHT_FINI_ARRAY, and SHT_PREINIT_ARRAY.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c17c2bd..878f22f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2016-05-20 Alan Modra <amodra@gmail.com>
+
+ PR gas/20118
+ * elf.c (elf_fake_sections): Set sh_entsize for SHT_INIT_ARRAY,
+ SHT_FINI_ARRAY, and SHT_PREINIT_ARRAY.
+
2016-05-19 Cupertino Miranda <cmiranda@synopsys.com>
* elf32-arc.c (arc_elf_final_write_processing): Changed.
diff --git a/bfd/elf.c b/bfd/elf.c
index 1592183..fa4cc4c 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3208,14 +3208,17 @@ elf_fake_sections (bfd *abfd, asection *asect, void *fsarg)
break;
case SHT_STRTAB:
- case SHT_INIT_ARRAY:
- case SHT_FINI_ARRAY:
- case SHT_PREINIT_ARRAY:
case SHT_NOTE:
case SHT_NOBITS:
case SHT_PROGBITS:
break;
+ case SHT_INIT_ARRAY:
+ case SHT_FINI_ARRAY:
+ case SHT_PREINIT_ARRAY:
+ this_hdr->sh_entsize = bed->s->arch_size / 8;
+ break;
+
case SHT_HASH:
this_hdr->sh_entsize = bed->s->sizeof_hash_entry;
break;