aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorRenlin Li <renlin.li@arm.com>2018-03-07 09:27:45 +0000
committerRenlin Li <renlin.li@arm.com>2018-03-07 14:47:27 +0000
commit0c1ded8dc0be9c61975e04a0b416b064223f7bda (patch)
treeea5508405d2eadfb08c3a9a45c323ee66fcb5915 /ld/testsuite
parente95a97d41a186ac65077ba3103dc10e5d41fe7b5 (diff)
downloadfsf-binutils-gdb-0c1ded8dc0be9c61975e04a0b416b064223f7bda.zip
fsf-binutils-gdb-0c1ded8dc0be9c61975e04a0b416b064223f7bda.tar.gz
fsf-binutils-gdb-0c1ded8dc0be9c61975e04a0b416b064223f7bda.tar.bz2
[PR20402][LD][AARCH64]Don't emit RELATIVE relocation for absolute symbols which are resolved at static linking time.
For absolute symbols which are forced local or not dynamic, the ABS relocation should be resolved at static linking time. Originally, an RELATIVE/ABS relocation will be generated even for absolution symbols for the dynamic linker to resolve. bfd/ 2018-03-07 Renlin Li <renlin.li@arm.com> PR ld/20402 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Check absolute symbol, and don't emit relocation in specific case. ld/ 2018-03-07 Renlin Li <renlin.li@arm.com> PR ld/20402 * testsuite/ld-aarch64/aarch64-elf.exp: Run new test. * testsuite/ld-aarch64/pr20402.s: New. * testsuite/ld-aarch64/pr20402.d: New.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-aarch64/aarch64-elf.exp1
-rw-r--r--ld/testsuite/ld-aarch64/pr20402.d7
-rw-r--r--ld/testsuite/ld-aarch64/pr20402.s6
3 files changed, 14 insertions, 0 deletions
diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp
index c67ffb1..de99a8b 100644
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
@@ -286,6 +286,7 @@ run_dump_test_lp64 "tprel_g2_overflow"
run_dump_test "tprel_add_lo12_overflow"
run_dump_test "protected-data"
run_dump_test_lp64 "pr22764"
+run_dump_test_lp64 "pr20402"
# ifunc tests
run_dump_test "ifunc-1"
diff --git a/ld/testsuite/ld-aarch64/pr20402.d b/ld/testsuite/ld-aarch64/pr20402.d
new file mode 100644
index 0000000..9cfeeb7
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/pr20402.d
@@ -0,0 +1,7 @@
+#ld: -pie -defsym foo=0x1 -defsym bar=0x2
+#readelf: -r
+
+Relocation section '\.rela\.dyn' at offset .* contains 2 entries:
+ Offset Info Type Sym\. Value Sym\. Name \+ Addend
+000000000000 000000000000 R_AARCH64_NONE 0
+000000000000 000000000000 R_AARCH64_NONE 0
diff --git a/ld/testsuite/ld-aarch64/pr20402.s b/ld/testsuite/ld-aarch64/pr20402.s
new file mode 100644
index 0000000..b18c5e7
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/pr20402.s
@@ -0,0 +1,6 @@
+ .text
+ .global _start
+ .hidden foo
+_start:
+ .xword foo
+ .xword bar