aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog4
-rw-r--r--ld/emultempl/aarch64elf.em10
-rw-r--r--ld/ld.texinfo7
-rw-r--r--ld/testsuite/ChangeLog7
-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
7 files changed, 158 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 722b837..6d495f7 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-24 Tejas Belagod <tejas.belagod@arm.com>
+
+ * emultempl/aarch64elf.em: Add command-line option for erratum 835769.
+
2014-10-17 Hans-Peter Nilsson <hp@axis.com>
Implement --print-sysroot in ld.
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
index bb58901..42e8056 100644
--- a/ld/emultempl/aarch64elf.em
+++ b/ld/emultempl/aarch64elf.em
@@ -30,6 +30,7 @@ fragment <<EOF
static int no_enum_size_warning = 0;
static int no_wchar_size_warning = 0;
static int pic_veneer = 0;
+static int fix_erratum_835769 = 0;
static void
gld${EMULATION_NAME}_before_parse (void)
@@ -302,7 +303,7 @@ aarch64_elf_create_output_section_statements (void)
bfd_elf${ELFSIZE}_aarch64_set_options (link_info.output_bfd, &link_info,
no_enum_size_warning,
no_wchar_size_warning,
- pic_veneer);
+ pic_veneer, fix_erratum_835769);
stub_file = lang_add_input_file ("linker stubs",
lang_input_file_is_fake_enum,
@@ -351,6 +352,7 @@ PARSE_AND_LIST_PROLOGUE='
#define OPTION_PIC_VENEER 310
#define OPTION_STUBGROUP_SIZE 311
#define OPTION_NO_WCHAR_SIZE_WARNING 312
+#define OPTION_FIX_ERRATUM_835769 313
'
PARSE_AND_LIST_SHORTOPTS=p
@@ -361,6 +363,7 @@ PARSE_AND_LIST_LONGOPTS='
{ "pic-veneer", no_argument, NULL, OPTION_PIC_VENEER},
{ "stub-group-size", required_argument, NULL, OPTION_STUBGROUP_SIZE },
{ "no-wchar-size-warning", no_argument, NULL, OPTION_NO_WCHAR_SIZE_WARNING},
+ { "fix-cortex-a53-835769", no_argument, NULL, OPTION_FIX_ERRATUM_835769},
'
PARSE_AND_LIST_OPTIONS='
@@ -378,6 +381,7 @@ PARSE_AND_LIST_OPTIONS='
after each stub section. Values of +/-1 indicate\n\
the linker should choose suitable defaults.\n"
));
+ fprintf (file, _(" --fix-cortex-a53-835769 Fix erratum 835769\n"));
'
PARSE_AND_LIST_ARGS_CASES='
@@ -397,6 +401,10 @@ PARSE_AND_LIST_ARGS_CASES='
pic_veneer = 1;
break;
+ case OPTION_FIX_ERRATUM_835769:
+ fix_erratum_835769 = 1;
+ break;
+
case OPTION_STUBGROUP_SIZE:
{
const char *end;
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 8eb7ba3..3001bf1 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -6570,6 +6570,13 @@ The @samp{--fix-cortex-a8} switch enables a link-time workaround for an erratum
The erratum only affects Thumb-2 code. Please contact ARM for further details.
+@cindex Cortex-A53 erratum 835769 workaround
+@kindex --fix-cortex-a53-835769
+@kindex --no-fix-cortex-a53-835769
+The @samp{--fix-cortex-a53-835769} switch enables a link-time workaround for erratum 835769 present on certain early revisions of Cortex-A53 processors. The workaround is disabled by default. It can be enabled by specifying @samp{--fix-cortex-a53-835769}, or disabled unconditionally by specifying @samp{--no-fix-cortex-a53-835769}.
+
+Please contact ARM for further details.
+
@kindex --merge-exidx-entries
@kindex --no-merge-exidx-entries
@cindex Merging exidx entries
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index d91e15e..d0ab7f5 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2014-10-24 Tejas Belagod <tejas.belagod@arm.com>
+
+ * ld-aarch64/aarch64-elf.exp (aarch64elftests): Drive erratum
+ 835769 tests.
+ * ld-aarch64/erratum835769.d: New.
+ * ld-aarch64/erratum835769.s: New.
+
2014-10-17 Hans-Peter Nilsson <hp@axis.com>
* ld-scripts/sysroot-prefix.exp: Log $ld_sysroot. Handle sysroot
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