diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2011-01-17 16:36:43 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2011-01-17 16:36:43 +0000 |
commit | da17376b704177fc4d8fa038169782e28b1f3b24 (patch) | |
tree | 67a2f1be8072c12de87992729ac98caf536875c5 | |
parent | 1e81e12b2c81710f5b098e18d5146d6704100913 (diff) | |
download | gdb-da17376b704177fc4d8fa038169782e28b1f3b24.zip gdb-da17376b704177fc4d8fa038169782e28b1f3b24.tar.gz gdb-da17376b704177fc4d8fa038169782e28b1f3b24.tar.bz2 |
bfd/
* elf32-arm.c (elf32_arm_check_relocs): Check needs_plt rather than
h->needs_plt when deciding whether to record a possible dynamic reloc.
ld/testsuite/
* ld-arm/arm-rel32.s, ld-arm/arm-rel32.d: New testcase.
* ld-arm/arm-elf.exp: Run it.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 2 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/arm-elf.exp | 3 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/arm-rel32.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/arm-rel32.s | 8 |
6 files changed, 34 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 93291ef..7c513d8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2011-01-17 Richard Sandiford <richard.sandiford@linaro.org> + * elf32-arm.c (elf32_arm_check_relocs): Check needs_plt rather than + h->needs_plt when deciding whether to record a possible dynamic reloc. + +2011-01-17 Richard Sandiford <richard.sandiford@linaro.org> + * elf32-arm.c (elf32_arm_gc_sweep_hook): Remove all registered dynamic relocs for the removed section. diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 8e9e30f..54001a3 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -11576,7 +11576,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, if ((info->shared || htab->root.is_relocatable_executable) && (sec->flags & SEC_ALLOC) != 0 && ((r_type == R_ARM_ABS32 || r_type == R_ARM_ABS32_NOI) - || (h != NULL && ! h->needs_plt + || (h != NULL && ! needs_plt && (! info->symbolic || ! h->def_regular)))) { struct elf_dyn_relocs *p, **head; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index fd92f26..678b547 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2011-01-17 Richard Sandiford <richard.sandiford@linaro.org> + * ld-arm/arm-rel32.s, ld-arm/arm-rel32.d: New testcase. + * ld-arm/arm-elf.exp: Run it. + +2011-01-17 Richard Sandiford <richard.sandiford@linaro.org> + * ld-arm/gc-thumb-lib.s, ld-arm/gc-thumb.s, ld-arm/gc-thumb.d: New test. * ld-arm/arm-elf.exp: Run it. diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index 9efdaf0..798b2cb 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -126,6 +126,9 @@ set armelftests { {"arm-rel31" "-static -T arm.ld" "" {arm-rel31.s} {{objdump -s arm-rel31.d}} "arm-rel31"} + {"arm-rel32" "-shared -T arm-dyn.ld" "" {arm-rel32.s} + {{objdump -Rsj.data arm-rel32.d}} + "arm-rel32"} {"arm-call" "-static -T arm.ld" "-meabi=4" {arm-call1.s arm-call2.s} {{objdump -d arm-call.d}} "arm-call"} diff --git a/ld/testsuite/ld-arm/arm-rel32.d b/ld/testsuite/ld-arm/arm-rel32.d new file mode 100644 index 0000000..919aaa4 --- /dev/null +++ b/ld/testsuite/ld-arm/arm-rel32.d @@ -0,0 +1,12 @@ + +.*: file format .* + +DYNAMIC RELOCATION RECORDS +OFFSET +TYPE +VALUE +[^ ]+ R_ARM_REL32 +foo +[^ ]+ R_ARM_REL32 +foo +[^ ]+ R_ARM_JUMP_SLOT +foo + + +Contents of section \.data: + [^ ]+ 00000000 00010000 .* diff --git a/ld/testsuite/ld-arm/arm-rel32.s b/ld/testsuite/ld-arm/arm-rel32.s new file mode 100644 index 0000000..885b87c --- /dev/null +++ b/ld/testsuite/ld-arm/arm-rel32.s @@ -0,0 +1,8 @@ + .globl foo +foo: + mov pc,lr + bal foo(PLT) + + .data + .word foo-. + .word foo-.+0x100 |