aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorRichard Earnshaw <richard.earnshaw@arm.com>2012-09-12 16:25:51 +0000
committerRichard Earnshaw <richard.earnshaw@arm.com>2012-09-12 16:25:51 +0000
commitf41aef5f6e10edcded9a747dc2bdc9832b940dc7 (patch)
tree0bf2b26ce0a0a473aa97b09e7a195ce29ab6d155 /ld/testsuite
parenta67fa328adaa260bc9293d4ea9058e12e2176cbc (diff)
downloadgdb-f41aef5f6e10edcded9a747dc2bdc9832b940dc7.zip
gdb-f41aef5f6e10edcded9a747dc2bdc9832b940dc7.tar.gz
gdb-f41aef5f6e10edcded9a747dc2bdc9832b940dc7.tar.bz2
2012-09-11 Chris Schlumberger-Socha <chris.schlumberger-socha@arm.com>
bfd/ * bfd-in2.h: Regenerated. * elf64-aarch64.c (elf64_aarch64_howto_table): Add R_AARCH64_GOT_LD_PREL19 reloc to HOWTO. (elf64_aarch64_reloc_map): Add reloc entry. (aarch64_resolve_relocation): Likewise. (bfd_elf_aarch64_put_addend): Likewise. (aarch64_reloc_got_type): Likewise. (elf64_aarch64_final_link_relocate): Likewise. (lf64_aarch64_check_relocs): Likewise. (elf64_aarch64_check_relocs): New case for R_AARCH64_ADR_PREL_LO21 reloc. * libbfd.h: Regenerated. * reloc.c (R_AARCH64_GOT_LD_PREL19): New reloc. gas/ * config/tc-aarch64.c (reloc_table): Add reloc to table entry. (parse_address_main): Add support for #:<reloc_op>:<symbol>. (parse_operands): Check for unused reloc. (md_apply_fix): New case for reloc. (aarch64_force_relocation): Likewise. gas/testsuite * gas/aarch64/reloc-insn.d (BFD_RELOC_AARCH64_GOT_LD_PREL19): Add expected asm for new reloc test. * gas/aarch64/reloc-insn.s (BFD_RELOC_AARCH64_GOT_LD_PREL19): Add test for reloc. include/ * elf/aarch64.h (R_AARCH64_GOT_LD_PREL19): New reloc. ld/testsuite * ld-aarch64/aarch64-elf.exp: New reloc tests. * ld-aarch64/emit-relocs-309-low-bad.d: New file. Expected asm for test failure (lower bound overflow). * ld-aarch64/emit-relocs-309-low.d: New file. Expected asm for test success (lower bound). * ld-aarch64/emit-relocs-309-up-bad.d: New file. Expected asm for test failure (upper bound overflow). * ld-aarch64/emit-relocs-309-up.d: New file. Expected asm for test success (upper bound). * ld-aarch64/emit-relocs-309.s: New file. Asm for new reloc tests.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog13
-rw-r--r--ld/testsuite/ld-aarch64/aarch64-elf.exp7
-rw-r--r--ld/testsuite/ld-aarch64/emit-relocs-309-low-bad.d5
-rw-r--r--ld/testsuite/ld-aarch64/emit-relocs-309-low.d12
-rw-r--r--ld/testsuite/ld-aarch64/emit-relocs-309-up-bad.d5
-rw-r--r--ld/testsuite/ld-aarch64/emit-relocs-309-up.d12
-rw-r--r--ld/testsuite/ld-aarch64/emit-relocs-309.s14
7 files changed, 67 insertions, 1 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 8183bf7..839da5b 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,16 @@
+2012-09-12 Chris Schlumberger-Socha <chris.schlumberger-socha@arm.com>
+
+ * ld-aarch64/aarch64-elf.exp: New reloc tests.
+ * ld-aarch64/emit-relocs-309-low-bad.d: New file. Expected asm for test
+ failure (lower bound overflow).
+ * ld-aarch64/emit-relocs-309-low.d: New file. Expected asm for test
+ success (lower bound).
+ * ld-aarch64/emit-relocs-309-up-bad.d: New file. Expected asm for test
+ failure (upper bound overflow).
+ * ld-aarch64/emit-relocs-309-up.d: New file. Expected asm for test
+ success (upper bound).
+ * ld-aarch64/emit-relocs-309.s: New file. Asm for new reloc tests.
+
2012-09-09 Hans-Peter Nilsson <hp@bitrange.com>
* ld-mmix/sec-1.d, ld-mmix/sec-3.d: Force end-of-section symbols
diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp
index eefe05a..7e5d73e 100644
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
@@ -78,7 +78,12 @@ run_dump_test "emit-relocs-286"
run_dump_test "emit-relocs-286-bad"
# 287-298 are not done yet
run_dump_test "emit-relocs-299"
-# 300-310 are not done yet
+# 300-308 are not done yet
+run_dump_test "emit-relocs-309-up"
+run_dump_test "emit-relocs-309-low"
+run_dump_test "emit-relocs-309-up-bad"
+run_dump_test "emit-relocs-309-low-bad"
+# 310 not done yet
run_dump_test "emit-relocs-311"
run_dump_test "emit-relocs-312"
diff --git a/ld/testsuite/ld-aarch64/emit-relocs-309-low-bad.d b/ld/testsuite/ld-aarch64/emit-relocs-309-low-bad.d
new file mode 100644
index 0000000..6c2d0dc
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/emit-relocs-309-low-bad.d
@@ -0,0 +1,5 @@
+#name: aarch64-emit-relocs-309-low-bad
+#source: emit-relocs-309.s
+#as:
+#ld: -Ttext 0xFFFFFD --section-start .got=0x0
+#error: .*relocation truncated to fit: R_AARCH64_GOT_LD_PREL19.*
diff --git a/ld/testsuite/ld-aarch64/emit-relocs-309-low.d b/ld/testsuite/ld-aarch64/emit-relocs-309-low.d
new file mode 100644
index 0000000..4dee982
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/emit-relocs-309-low.d
@@ -0,0 +1,12 @@
+#name: aarch64-emit-relocs-309-low
+#source: emit-relocs-309.s
+#as:
+#ld: -Ttext 0xFFFFC --section-start .got=0x0
+#objdump: -dr
+#...
+
+Disassembly of section \.text:
+
+00000000000ffffc <_start>:
+ ffffc: d503201f nop
+ 100000: 58800000 ldr x0, 0 <_GLOBAL_OFFSET_TABLE_-0x8>
diff --git a/ld/testsuite/ld-aarch64/emit-relocs-309-up-bad.d b/ld/testsuite/ld-aarch64/emit-relocs-309-up-bad.d
new file mode 100644
index 0000000..802b51e
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/emit-relocs-309-up-bad.d
@@ -0,0 +1,5 @@
+#name: aarch64-emit-relocs-309-up-bad
+#source: emit-relocs-309.s
+#as:
+#ld: -Ttext 0x0 --section-start .got=0x100001
+#error: .*relocation truncated to fit: R_AARCH64_GOT_LD_PREL19.*
diff --git a/ld/testsuite/ld-aarch64/emit-relocs-309-up.d b/ld/testsuite/ld-aarch64/emit-relocs-309-up.d
new file mode 100644
index 0000000..dc2bb55
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/emit-relocs-309-up.d
@@ -0,0 +1,12 @@
+#name: aarch64-emit-relocs-309-up
+#source: emit-relocs-309.s
+#as:
+#ld: -Ttext 0x0 --section-start .got=0x100000
+#objdump: -dr
+#...
+
+Disassembly of section \.text:
+
+0000000000000000 <_start>:
+ 0: d503201f nop
+ 4: 587fffe0 ldr x0, 100000 <_stack\+0x80000>
diff --git a/ld/testsuite/ld-aarch64/emit-relocs-309.s b/ld/testsuite/ld-aarch64/emit-relocs-309.s
new file mode 100644
index 0000000..d66c64b
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/emit-relocs-309.s
@@ -0,0 +1,14 @@
+# R_AARCH64_GOT_LD_PREL19 must satisfy condition:
+#
+# -2^20 <= G(S) - P < 2^20
+#
+
+ .comm src,1,8
+
+ .global _start
+
+ .text
+
+_start:
+ nop
+ ldr x0, :got_prel19:src