diff options
author | Nick Clifton <nickc@redhat.com> | 2013-06-13 12:36:02 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2013-06-13 12:36:02 +0000 |
commit | 2f47f5fc1338185064d87c4ab54773a9f4cfe796 (patch) | |
tree | e84941b49ccded12a0fbd2ae29dbb6dd448c65d6 /bfd | |
parent | 909c7f9cbf0b6c33f14a68be54723c89cfbadf8c (diff) | |
download | gdb-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')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 01f050d..3a3c8f8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2013-06-13 Terry Guo <terry.guo@arm.com> + + 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. + 2013-06-11 DJ Delorie <dj@redhat.com> * elf32-rl78.c (rl78_elf_relocate_section): Fix OPsub math. 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; |