aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-03-12 13:12:37 +0000
committerNick Clifton <nickc@redhat.com>2014-03-12 13:12:37 +0000
commitc792917cdc10a5ada2f4f73ecb39c764756bf994 (patch)
tree8430a35a33ef56024a56d157018854e7794e8e0a /bfd/elf32-arm.c
parent8a1373cc51a55646633a9bedefbf722e5a3486ed (diff)
downloadgdb-c792917cdc10a5ada2f4f73ecb39c764756bf994.zip
gdb-c792917cdc10a5ada2f4f73ecb39c764756bf994.tar.gz
gdb-c792917cdc10a5ada2f4f73ecb39c764756bf994.tar.bz2
Prevent the linker from generaing a seg-fault when the user attempts to link
an ARM ELF binary into an AARCH64 ELF executable. PR ld/16671 * elf32-arm.c (elf32_arm_add_symbol_hook): Check for ARM format before testing for vxworks.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 4692a05..1aae31b 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -15861,6 +15861,9 @@ elf32_arm_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
|| ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
+ if (elf32_arm_hash_table (info) == NULL)
+ return FALSE;
+
if (elf32_arm_hash_table (info)->vxworks_p
&& !elf_vxworks_add_symbol_hook (abfd, info, sym, namep,
flagsp, secp, valp))