aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 1be3346..580d590 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -8043,7 +8043,9 @@ elf32_arm_gc_mark_extra_sections(struct bfd_link_info *info,
Elf_Internal_Shdr *hdr;
hdr = &elf_section_data (o)->this_hdr;
- if (hdr->sh_type == SHT_ARM_EXIDX && hdr->sh_link
+ if (hdr->sh_type == SHT_ARM_EXIDX
+ && hdr->sh_link
+ && hdr->sh_link < elf_numsections (sub)
&& !o->gc_mark
&& elf_shdrp[hdr->sh_link]->bfd_section->gc_mark)
{