[PATCH] Enable use of ARMv5t BLX for Thumb-mode calls via PLT
Julian Brown
julian@codesourcery.com
Mon Apr 11 18:55:00 GMT 2005
Hi,
This patch allows the ARMv5t Thumb BLX instruction to be used
(optionally) to call PLT entries, which should provide a slight speed
boost. A previous, SymbianOS-specific version of the patch was posted here:
http://sourceware.org/ml/binutils/2005-03/msg00433.html
With this patch, the option "--use-thumb-blx" can be passed to the
linker to enable the use of the BLX instruction when the target supports
it. The format of the PLT itself isn't changed by this patch: there is
still a Thumb stub before each ARM PLT entry, but it is now unused. The
ARM mode entry is called directly instead.
Additionally, an instruction-encoding bug is fixed from the previous
unapplied version of the patch, and an uninitialised value is now
initialised (fix_v4bx field in elf32_arm_link_hash_table_create, just
cosmetic I think).
Tested on arm-none-eabi and arm-none-symbianelf.
OK to apply?
ChangeLog:
bfd:
* bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
* bfd-in2.h: Regenerate.
* elf32-arm.c (elf32_arm_link_hash_table): New field, 'use_thumb_blx'.
(elf32_arm_link_hash_table_create): Initialise fix_v4bx,
use_thumb_blx.
(bfd_elf32_arm_set_target_relocs): Handle use_thumb_blx.
(elf32_arm_final_link_relocate): Use Thumb BLX for R_ARM_THM_PC22
relocations if requested to.
(elf32_arm_symbian_link_hash_table_create): Enable use_thumb_blx by
default for SymbianOS.
ld:
* ld.texinfo: Document --use-thumb-blx.
* emultempl/armelf.em (use_thumb_blx): New variable.
(arm_elf_create_output_section_statements): Communicate value of
use_thumb_blx to bfd.
(PARSE_AND_LIST_PROLOGUE): Add OPTION_USE_THUMB_BLX.
(PARSE_AND_LIST_OPTIONS): Add --use-thumb-blx option.
(PARSE_AND_LIST_ARGS_CASES): Add OPTION_USE_THUMB_BLX case.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-2
URL: <https://sourceware.org/pipermail/binutils/attachments/20050411/69db503c/attachment.ksh>
More information about the Binutils
mailing list