Commit Graph

11 Commits

Author SHA1 Message Date
Marcus Shawcroft 4106101c44 [AArch64] Workaround for Cortex A53 erratum 843419
Some early revisions of the Cortex-A53 have an erratum (843419).  The
details of the erratum are quite complex and involve dynamic
conditions.  For the purposes of the workaround we have simplified the
static conditions to an ADRP in the last two instructions of a 4KByte
page, followed within four instructions by a load/store dependent on
the ADRP.

This patch adds support to conservatively scan for and workaround
Cortex A53 erratum 843419.  There are two different workaround
strategies used.  The first is to rewrite ADRP instructions which form
part of an erratum sequence with an ADR instruction.  In situations
where the ADR provides insufficient offset the dependent load or store
instruction from the sequence is moved to a stub section and branches
are inserted from the original sequence to the relocated instruction
and back again.

Stub section sizes are rounded up to a multiple of 4096 in order to
ensure that the act of inserting work around stubs does not create
more errata sequences.

Workaround stubs are always inserted into the stub section associated
with the input section containing the erratum sequence.  This ensures
that the fully relocated form of the veneered load store instruction
is available at the point in time when the stub section is written.
2015-04-01 13:16:38 +01:00
Marcus Shawcroft d9ced15d6e [AArch64] Remove padding before stub sections.
Lower stub alignment from 8 to 4 bytes thus removing padding between
input section content and stub section content.
2015-03-25 15:15:40 +00:00
Marcus Shawcroft 499c37b59a [AArch64] Adjust layout emultempl/aarch64elf.em. 2015-03-23 14:35:21 +00:00
Alan Modra b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
Jiong Wang 68fcca92b7 [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.
2014-10-24 11:39:35 +01:00
Alan Modra 759388538d Return error status from bfd_elf_discard_info.
bfd/
	* elflink.c (bfd_elf_discard_info): Return int error status.
	* stabs.c (_bfd_discard_section_stabs): Comment typo fix.
	* bfd-in.h (bfd_elf_discard_info): Updata prototype.
	* bfd-in2.h: Regenerate.
ld/
	* emultempl/aarch64elf.em (gld${EMULATION_NAME}_after_allocation):
	Handle error status from bfd_elf_discard_info.
	* emultempl/armelf.em: Likewise.
	* emultempl/elf32.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/metagelf.em: Likewise.
	* emultempl/nios2elf.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/tic6xdsbt.em: Likewise.
	* emultempl/vms.em: Likewise.
2014-08-18 09:33:35 +09:30
Alan Modra 4b95cf5c0c Update copyright years 2014-03-05 22:16:15 +10:30
Guy Martin 24ef1aa73e Fix duplicate output section statement lookup
Tie output section statements to their associated output section via
output section userdata.  This allows us to avoid hash lookups which
are slower and fail when multiple output sections have the same name.

	* ldlang.h (lang_output_section_get): Define.
	* ldlang.c (lang_output_section_get): Likewise.
	(init_os): Set the output_section userdata to the output
	section statement.
	* emultempl/hppaelf.em: Use lang_output_section_get instead of
	lang_output_section_find where applicable.
	* emultempl/aarch64elf.em: Likewise.
	* emultempl/aix.em: Likewise.
	* emultempl/armelf.em: Likewise.
	* emultempl/m68hc1xelf.em: Likewise.
	* emultempl/metagelf.em: Likewise.
	* emultempl/mipself.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/spuelf.em: Likewise.
2014-01-20 14:21:36 +10:30
Yufeng Zhang 4390599b4e ld/
* emulparams/aarch64elf.sh: Define ELFSIZE=64.
	* emulparams/aarch64linux.sh: Ditto.
	* emultempl/aarch64elf.em (aarch64_elf_before_allocation):
	Replace elf64 with elf${ELFSIZE}.
	(elf64_aarch64_add_stub_section): Likewise.
	(build_section_lists): Likewise.
	(gld${EMULATION_NAME}_after_allocation): Likewise.
	(gld${EMULATION_NAME}_finish): Likewise.
	(aarch64_elf_create_output_section_statements): Likewise.
2013-04-24 17:22:31 +00:00
Roland McGrath e2caaa1f59 ld/
* emultempl/aarch64elf.em (gld${EMULATION_NAME}_before_parse):
	Copy last elf32.em here too.
	* emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Likewise.
	* emultempl/mmixelf.em (gld${EMULATION_NAME}_before_parse): Likewise.
	* emultempl/scoreelf.em (gld${EMULATION_NAME}_before_parse): Likewise.
2012-11-26 23:26:35 +00:00
Nick Clifton a06ea96464 Add support for 64-bit ARM architecture: AArch64 2012-08-13 14:52:54 +00:00