From e2b060be9823f53d2acd7bc7b5fe06cc4d940063 Mon Sep 17 00:00:00 2001 From: Lai Wei-Chih Date: Thu, 16 Oct 2014 13:16:09 +0800 Subject: [2.24][2.25] Backport prevent user links ARM ELF binary into an AARCH64 ELF executable. Prevent the linker from generating a seg-fault when the user attempts to link an ARM ELF binary into an AARCH64 ELF executable. 2014-03-12 Nick Clifton PR ld/16671 * elf32-arm.c (elf32_arm_add_symbol_hook): Check for ARM format before testing for vxworks. Change-Id: Ibc81a168b85f70422d428d857b8de0c71e2824ed --- binutils-2.25/bfd/elf32-arm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'binutils-2.25/bfd') diff --git a/binutils-2.25/bfd/elf32-arm.c b/binutils-2.25/bfd/elf32-arm.c index 197af595..9c31ddd7 100644 --- a/binutils-2.25/bfd/elf32-arm.c +++ b/binutils-2.25/bfd/elf32-arm.c @@ -15700,6 +15700,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)) -- cgit v1.2.3