summaryrefslogtreecommitdiff
path: root/ld/emultempl/aarch64elf.em
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/emultempl/aarch64elf.em
parent79ccd89e582a1159a503813be020d044e070d53f (diff)
downloadbinutils-gdb-68fcca92b735bb46e38331485ac2e933e5876b83.tar.gz
[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/emultempl/aarch64elf.em')
-rw-r--r--ld/emultempl/aarch64elf.em10
1 files changed, 9 insertions, 1 deletions
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
index bb589012061..42e8056f67e 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;