aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-aarch64
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2014-10-24 11:39:35 +0100
committerJiong Wang <jiong.wang@arm.com>2014-10-24 11:39:35 +0100
commit68fcca92b735bb46e38331485ac2e933e5876b83 (patch)
tree586a3f1bf8c983437c2f084e078cd6402a930e7c /ld/testsuite/ld-aarch64
parent79ccd89e582a1159a503813be020d044e070d53f (diff)
downloadgdb-68fcca92b735bb46e38331485ac2e933e5876b83.zip
gdb-68fcca92b735bb46e38331485ac2e933e5876b83.tar.gz
gdb-68fcca92b735bb46e38331485ac2e933e5876b83.tar.bz2
[AArch64] Cortex-A53 erratum 835769 linker workaround
2014-10-22 Tejas Belagod <tejas.belagod@arm.com> bfd/ * bfd-in.h (bfd_elf64_aarch64_set_options): Add a parameter. * bfd-in2.h (bfd_elf64_aarch64_set_options): Likewise. * elfnn-aarch64.c (aarch64_erratum_835769_stub): New. (elf_aarch64_stub_type): Add new type aarch64_stub_erratum_835769_veneer. (elf_aarch64_stub_hash_entry): New fields for erratum 835769. (aarch64_erratum_835769_fix): New data struct to record erratum 835769. (elf_aarch64_link_hash_table: Global flags for 835769. (aarch64_build_one_stub): Add case for 835769. (aarch64_size_one_stub): Likewise. (aarch64_mem_op_p, aarch64_mlxl_p, aarch64_erratum_sequence,erratum_835769_scan): New. Decode and scan functions for erratum 835769. (elf_aarch64_create_or_find_stub_sec): New. (elfNN_aarch64_size_stubs): Look for erratum 835769 and record them. (bfd_elfNN_aarch64_set_options: Set global flag for 835769. (erratum_835769_branch_to_stub_data, make_branch_to_erratum_835769_stub):New. Connect up all the erratum stubs to occurances by branches. (elfNN_aarch64_write_section): New hook. (aarch64_map_one_stub): Output erratum stub symbol. (elfNN_aarch64_size_dynamic_sections): Init mapping symbol information for erratum 835769. (elf_backend_write_section): Define. ld/ * emultempl/aarch64elf.em: Add command-line option for erratum 835769. ld/testsuite/ * ld-aarch64/aarch64-elf.exp (aarch64elftests): Drive erratum 835769 tests. * ld-aarch64/erratum835769.d: New. * ld-aarch64/erratum835769.s: New.
Diffstat (limited to 'ld/testsuite/ld-aarch64')
-rw-r--r--ld/testsuite/ld-aarch64/aarch64-elf.exp8
-rw-r--r--ld/testsuite/ld-aarch64/erratum835769.d48
-rw-r--r--ld/testsuite/ld-aarch64/erratum835769.s75
3 files changed, 131 insertions, 0 deletions
diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp
index b3f6eb5..a75e070 100644
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
@@ -35,6 +35,14 @@ if { ![is_elf_format] || ![istarget "aarch64*-*-*"] } {
set aarch64elftests {
{"EH Frame merge" "-Ttext 0x8000" "" "" {eh-frame-bar.s eh-frame-foo.s}
{{objdump --dwarf=frames eh-frame.d}} "eh-frame"}
+ {"Erratum 835769 dump test"
+ "--fix-cortex-a53-835769" "" "" {erratum835769.s}
+ {{objdump -dr erratum835769.d}}
+ "erratum835769"}
+ {"Erratum 835769 dump test -shared"
+ "--fix-cortex-a53-835769 -shared" "" "" {erratum835769.s}
+ {{objdump -dr erratum835769.d}}
+ "erratum835769"}
}
run_ld_link_tests $aarch64elftests
diff --git a/ld/testsuite/ld-aarch64/erratum835769.d b/ld/testsuite/ld-aarch64/erratum835769.d
new file mode 100644
index 0000000..a040236
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/erratum835769.d
@@ -0,0 +1,48 @@
+#...
+Disassembly of section .text:
+#...
+[0-9a-f]+ <a1ldr>:
+[ \t0-9a-f]+:[ \t]+b8408c87[ \t]+ldr[ \t]+w7, \[x4,#8\]\!
+[ \t0-9a-f]+:[ \t]+1b017c06[ \t]+mul[ \t]+w6, w0, w1
+[ \t0-9a-f]+:[ \t]+f9400084[ \t]+ldr[ \t]+x4, \[x4\]
+[ \t0-9a-f]+:[ \t0-9a-z]+[ \t]+b[ \t]+[0-9a-f]+ <__erratum_835769_veneer_0>
+[ \t0-9a-f]+:[ \t]+aa0503e0[ \t]+mov[ \t]+x0, x5
+[ \t0-9a-f]+:[ \t]+d65f03c0[ \t]+ret
+
+[0-9a-f]+ <a5ldr>:
+[ \t0-9a-f]+:[ \t]+b8408c87[ \t]+ldr[ \t]+w7, \[x4,#8\]!
+[ \t0-9a-f]+:[ \t]+1b017c06[ \t]+mul[ \t]+w6, w0, w1
+[ \t0-9a-f]+:[ \t]+f9400084[ \t]+ldr[ \t]+x4, \[x4\]
+[ \t0-9a-f]+:[ \t0-9a-z]+[ \t]+b[ \t]+[0-9a-f]+ <__erratum_835769_veneer_1>
+[ \t0-9a-f]+:[ \t]+aa0503e0[ \t]+mov[ \t]+x0, x5
+[ \t0-9a-f]+:[ \t]+d65f03c0[ \t]+ret
+
+[0-9a-f]+ <a6ldr>:
+[ \t0-9a-f]+:[ \t]+b8408c87[ \t]+ldr[ \t]+w7, \[x4,#8\]!
+[ \t0-9a-f]+:[ \t]+1b017c06[ \t]+mul[ \t]+w6, w0, w1
+[ \t0-9a-f]+:[ \t]+f9400084[ \t]+ldr[ \t]+x4, \[x4\]
+[ \t0-9a-f]+:[ \t]+9b031885[ \t]+madd[ \t]+x5, x4, x3, x6
+[ \t0-9a-f]+:[ \t]+aa0503e0[ \t]+mov[ \t]+x0, x5
+[ \t0-9a-f]+:[ \t]+d65f03c0[ \t]+ret
+
+[0-9a-f]+ <a7str>:
+[ \t0-9a-f]+:[ \t]+b8408c87[ \t]+ldr[ \t]+w7, \[x4,#8\]!
+[ \t0-9a-f]+:[ \t]+1b017c06[ \t]+mul[ \t]+w6, w0, w1
+[ \t0-9a-f]+:[ \t]+f9000084[ \t]+str[ \t]+x4, \[x4\]
+[ \t0-9a-f]+:[ \t0-9a-z]+[ \t]+b[ \t]+[0-9a-f]+ <__erratum_835769_veneer_2>
+[ \t0-9a-f]+:[ \t]+aa0503e0[ \t]+mov[ \t]+x0, x5
+[ \t0-9a-f]+:[ \t]+d65f03c0[ \t]+ret
+[ \t0-9a-f]+:[ \t]+00000000[ \t]+.inst[ \t]+0x00000000 ; undefined
+
+[0-9a-f]+ <__erratum_835769_veneer_2>:
+[ \t0-9a-f]+:[ \t]+9b031885[ \t]+madd[ \t]+x5, x4, x3, x6
+[ \t0-9a-f]+:[ \t0-9a-z]+[ \t]+b[ \t]+[0-9a-f]+ <a7str\+0x[0-9a-f]+>
+
+[0-9a-f]+ <__erratum_835769_veneer_1>:
+[ \t0-9a-f]+:[ \t]+9ba31845[ \t]+umaddl[ \t]+x5, w2, w3, x6
+[ \t0-9a-f]+:[ \t0-9a-z]+[ \t]+b[ \t]+[0-9a-f]+ <a5ldr\+0x[0-9a-f]+>
+
+[0-9a-f]+ <__erratum_835769_veneer_0>:
+[ \t0-9a-f]+:[ \t]+9b031845[ \t]+madd[ \t]+x5, x2, x3, x6
+[ \t0-9a-f]+:[ \t0-9a-z]+[ \t]+b[ \t]+[0-9a-f]+ <a1ldr\+0x[0-9a-f]+>
+#pass
diff --git a/ld/testsuite/ld-aarch64/erratum835769.s b/ld/testsuite/ld-aarch64/erratum835769.s
new file mode 100644
index 0000000..d57b5ab
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/erratum835769.s
@@ -0,0 +1,75 @@
+ .text
+ .align 2
+ .global main
+ .type main, %function
+main:
+ stp x29, x30, [sp, -32]!
+ add x29, sp, 0
+ mov x0, -26
+ str x0, [x29,16]
+ mov x0, 26
+ str x0, [x29,24]
+ add x4, x29, 16
+ mov x0, -1
+ mov x1, 2
+ mov x2, -3
+ mov x3, 4
+ bl a1ldr
+ add x4, x29, 16
+ mov x0, -1
+ mov x1, 2
+ mov x2, -3
+ mov x3, 4
+ bl a5ldr
+ mov w0, 0
+ ldp x29, x30, [sp], 32
+ ret
+ .size main, .-main
+
+ .align 2
+ .global a1ldr
+ .type a1ldr, %function
+a1ldr:
+ ldr w7, [x4,8]!
+ mul w6, w0, w1
+ ldr x4, [x4]
+ madd x5, x2, x3, x6
+ mov x0, x5
+ ret
+ .size a1ldr, .-a1ldr
+
+ .align 2
+ .global a5ldr
+ .type a5ldr, %function
+a5ldr:
+ ldr w7, [x4,8]!
+ mul w6, w0, w1
+ ldr x4, [x4]
+ umaddl x5, w2, w3, x6
+ mov x0, x5
+ ret
+ .size a5ldr, .-a5ldr
+
+ .align 2
+ .global a6ldr
+ .type a6ldr, %function
+a6ldr:
+ ldr w7, [x4,8]!
+ mul w6, w0, w1
+ ldr x4, [x4]
+ madd x5, x4, x3, x6
+ mov x0, x5
+ ret
+ .size a6ldr, .-a6ldr
+
+ .align 2
+ .global a6ldr
+ .type a6ldr, %function
+a7str:
+ ldr w7, [x4,8]!
+ mul w6, w0, w1
+ str x4, [x4]
+ madd x5, x4, x3, x6
+ mov x0, x5
+ ret
+ .size a7str, .-a7str