+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.
/* 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.
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;
+2013-06-13 Terry Guo <terry.guo@arm.com>
+
+ 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.
+
2013-06-07 Will Newton <will.newton@linaro.org>
* ld-ifunc/ifunc.exp: Enable ifunc tests for AArch64.
# Expect script for various ARM ELF tests.
-# Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012
-# Free Software Foundation, Inc.
+# Copyright 2002-2013 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
{"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-bad.s}
{{objdump -d thumb2-bl-bad.d}}
"thumb2-bl-bad"}
+ {"Branch to linker script symbol with BL for thumb-only target" "-T branch-lks-sym.ld" "" "" {thumb-bl-lks-sym.s}
+ {{objdump -d thumb-bl-lks-sym.d}}
+ "thumb-bl-lks-sym"}
+ {"Branch to linker script symbol with B for thumb-only target" "-T branch-lks-sym.ld" "" "" {thumb-b-lks-sym.s}
+ {{objdump -d thumb-b-lks-sym.d}}
+ "thumb-b-lks-sym"}
{"ARM-ARM farcall" "-Ttext 0x1000 --section-start .foo=0x2001020" "" "" {farcall-arm-arm.s}
{{objdump -d farcall-arm-arm.d}}
--- /dev/null
+extFunc = 0x1000 + 1;
--- /dev/null
+
+.*: file format.*
+
+Disassembly of section .text:
+
+00000000 <main>:
+ 0: f000 bffe b.w 1000 <extFunc>
--- /dev/null
+@ Test to ensure that the b to linker script symbol isn't changed to other format.
+
+
+ .syntax unified
+ .cpu cortex-m3
+ .fpu softvfp
+ .thumb
+ .file "x.c"
+ .text
+ .align 2
+ .global main
+ .thumb
+ .thumb_func
+ .type main, %function
+main:
+ b extFunc
--- /dev/null
+
+.*: file format.*
+
+Disassembly of section .text:
+
+00000000 <main>:
+ 0: b580 push {r7, lr}
+ 2: af00 add r7, sp, #0
+ 4: f000 fffc bl 1000 <extFunc>
+ 8: bd80 pop {r7, pc}
+ a: bf00 nop
+
--- /dev/null
+@ Test to ensure that the bl to linker script symbol isn't changed to blx with immediate address.
+
+
+ .syntax unified
+ .cpu cortex-m3
+ .fpu softvfp
+ .thumb
+ .file "x.c"
+ .text
+ .align 2
+ .global main
+ .thumb
+ .thumb_func
+ .type main, %function
+main:
+ push {r7, lr}
+ add r7, sp, #0
+ bl extFunc
+ pop {r7, pc}