From: Nick Clifton Date: Wed, 12 Mar 2014 13:12:37 +0000 (+0000) Subject: Prevent the linker from generaing a seg-fault when the user attempts to link X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c792917cdc10a5ada2f4f73ecb39c764756bf994;p=binutils-gdb.git 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9872f98d25c..7ecaed68137 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2014-03-12 Nick Clifton + + PR ld/16671 + * elf32-arm.c (elf32_arm_add_symbol_hook): Check for ARM format + before testing for vxworks. + 2014-03-12 Alan Modra * Makefile.in: Regenerate. diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 4692a0579b8..1aae31b4c90 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))