aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-06-13 12:36:02 +0000
committerNick Clifton <nickc@redhat.com>2013-06-13 12:36:02 +0000
commit2f47f5fc1338185064d87c4ab54773a9f4cfe796 (patch)
treee84941b49ccded12a0fbd2ae29dbb6dd448c65d6 /bfd/elf32-arm.c
parent909c7f9cbf0b6c33f14a68be54723c89cfbadf8c (diff)
downloadgdb-2f47f5fc1338185064d87c4ab54773a9f4cfe796.zip
gdb-2f47f5fc1338185064d87c4ab54773a9f4cfe796.tar.gz
gdb-2f47f5fc1338185064d87c4ab54773a9f4cfe796.tar.bz2
PR ld/15302
* elf32-arm.c (allocate_dynrelocs_for_symbol): Transform ST_BRANCH_TO_ARM into ST_BRANCH_TO_THUMB if the target only supports thumb instructions. PR ld/15302 * ld-arm/branch-lks-sym.ld: New script. * ld-arm/thumb-b-lks-sym.s: New test. * ld-arm/thumb-b-lks-sym.d: Expected disassembly. * ld-arm/thumb-bl-lks-sym.s: New test. * ld-arm/thumb-bl-lks-sym.d: Expected disassembly. * ld-arm/arm-elf.exp: Run the new tests.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 2ed4741..fe01c9a 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -1,6 +1,5 @@
/* 32-bit ELF support for ARM
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+ Copyright 1998-2013 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -13341,6 +13340,12 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf)
h->root.u.def.value = th->root.u.def.value & ~1;
}
+ /* Make sure we are not applying ST_BRANCH_TO_ARM to symbols
+ for thumb-only targets. */
+ if (using_thumb_only (htab)
+ && h->target_internal == ST_BRANCH_TO_ARM)
+ h->target_internal = ST_BRANCH_TO_THUMB;
+
if (eh->dyn_relocs == NULL)
return TRUE;