aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2008-11-25 15:53:27 +0000
committerJoseph Myers <joseph@codesourcery.com>2008-11-25 15:53:27 +0000
commit1954000798df4fa1571ee51994105b75f31959d1 (patch)
treecca332ecbd384c8eec75a1fd5bdcd85ed9c096ef /ld
parent83bac4b0108234603a1674d820d0188c9f8c4e68 (diff)
downloadbinutils-1954000798df4fa1571ee51994105b75f31959d1.zip
binutils-1954000798df4fa1571ee51994105b75f31959d1.tar.gz
binutils-1954000798df4fa1571ee51994105b75f31959d1.tar.bz2
bfd:
* elf32-arm.c (elf32_arm_final_link_relocate): Do not turn branches to undefine weak symbols into branches to the next instruction if creating PLT entries for those symbols. ld/testsuite: * ld-arm/thumb2-bl-undefweak.d, ld-arm/thumb2-bl-undefweak.s: New. * ld-arm/arm-elf.exp: Run thumb2-bl-undefweak test.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp1
-rw-r--r--ld/testsuite/ld-arm/thumb2-bl-undefweak.d9
-rw-r--r--ld/testsuite/ld-arm/thumb2-bl-undefweak.s10
4 files changed, 25 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index f46a7e1..7157245 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-25 Joseph Myers <joseph@codesourcery.com>
+
+ * ld-arm/thumb2-bl-undefweak.d, ld-arm/thumb2-bl-undefweak.s: New.
+ * ld-arm/arm-elf.exp: Run thumb2-bl-undefweak test.
+
2008-11-25 Hans-Peter Nilsson <hp@axis.com>
* ld-cris/got7.s, ld-cris/init.s, ld-cris/pic-gc-72.d,
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index 6075e68..665dab1 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -184,6 +184,7 @@ run_dump_test "group-relocs-alu-bad"
run_dump_test "group-relocs-ldr-bad"
run_dump_test "group-relocs-ldrs-bad"
run_dump_test "group-relocs-ldc-bad"
+run_dump_test "thumb2-bl-undefweak"
run_dump_test "emit-relocs1"
# Exclude non-ARM-EABI targets.
diff --git a/ld/testsuite/ld-arm/thumb2-bl-undefweak.d b/ld/testsuite/ld-arm/thumb2-bl-undefweak.d
new file mode 100644
index 0000000..d06f1ab
--- /dev/null
+++ b/ld/testsuite/ld-arm/thumb2-bl-undefweak.d
@@ -0,0 +1,9 @@
+#source: thumb2-bl-undefweak.s
+#as:
+#ld: -shared
+#objdump: -dr
+#...
+Disassembly of section .text:
+
+.* <foo>:
+ .*: .... .... blx ... <foo-0x.*>
diff --git a/ld/testsuite/ld-arm/thumb2-bl-undefweak.s b/ld/testsuite/ld-arm/thumb2-bl-undefweak.s
new file mode 100644
index 0000000..5e70eea
--- /dev/null
+++ b/ld/testsuite/ld-arm/thumb2-bl-undefweak.s
@@ -0,0 +1,10 @@
+@ Test that calls to undefined weak functions resolve to call through
+@ the PLT in shared libraries.
+
+ .arch armv7
+ .syntax unified
+ .text
+ .thumb_func
+foo:
+ bl bar
+ .weak bar