[RFA/ARM]: Patch to workaround ARM1176 BLX (immediate) Thumb to ARM issue

Matthew Gretton-Dann matthew.gretton-dann@arm.com
Wed Jul 27 16:29:00 GMT 2011
Hi,

Please can someone review and approve the attached patch?

The patch does the following:

      * Adds a command line option to ld --[no-]fix-erratum-760522, which
        is enabled by default.
      * When the option is on the linker will only use BLX if the target
        architecture (derived from the object files) is v6T2, v7, or
        greater.
      * --use-blx keeps its current meaning and will override this
        option.

A description of the issue can be found on the ARM website at:

http://infocenter.arm.com/help/topic/com.arm.doc.uan0002a/UAN002A_1176-pan_use_of_blx.pdf

Alternatively by following:
    http://infocenter.arm.com/
      User Assistance Notes
        ARM11 Processors
          ARM1176JZ-S and ARM1176JFZ-S Programmer Advice Note

The workaround has been applied to more cores than just ARM1176 to 
ensure appropriate forwards compatibility from earlier CPUs.

Thanks,

Matt

bfd/ChangeLog:
2011-07-27  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>

	* bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
	* bfd-in2.h (bfd_elf32_arm_set_target_relocs): Likewise.
	* elf32-arm.c (elf32_arm_link_hash_table): New field.
	(elf232_arm_link_hash_table_create): Initialise new field.
	(check_use_blx): Change test depending on fix_erratum_760522.
	(bfd_elf32_arm_set_target_relocs): Set fix_erratum_760522 from
	command line options.

ld/ChangeLog:
2011-07-27  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>

	* emultempl/armelf.em (fix_erratum_760522): New variable.
	(arm_elf_create_output_section_statements): Pass
	fix_erratum_760522 option to bfd backend.
	(OPTION_FIX_ERRATUM_760522): New define.
	(OPTION_NO_FIX_ERRATUM_760522): Likewise.
	(PARSE_AND_LIST_LONGOPTS): Add --[no-]fix-erratum-760522
	command line options.
	(PARSE_AND_LIST_OPTIONS): Likewise.
	(PARSE_AND_LIST_ARGS_CASES): Likewise.

ld/testsuite/ChangeLog:
2011-07-27  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>

	* ld-arm/arm-elf.exp (armelftests): Update for new command-line
	options.
	(armeabitests): Update for new command-line options, and add
	new test cases.
	* ld-arm/erratum-760522-off.d: New test case.
	* ld-arm/erratum-760522-on.d: Likewise.
	* ld-arm/erratum-760522.s: Likewise.


Thanks,

Matt

-- 
Matthew Gretton-Dann
Principal Engineer, PD Software - Tools, ARM Ltd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1107-fix-erratum-760522.patch
Type: text/x-patch
Size: 16162 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20110727/7b0e6c53/attachment.bin>


More information about the Binutils mailing list