[PATCH] Add support for ARM AAPCS R_ARM_V4BX relocation type
Richard Earnshaw
rearnsha@gcc.gnu.org
Fri Jan 28 15:31:00 GMT 2005
On Fri, 2005-01-28 at 15:23, Julian Brown wrote:
> Hi,
>
> This patch adds support for the R_ARM_V4BX relocation type to bfd and
> ld. This allows objects compiled for the ARMv4 architecture to be
> interworking-safe when linked with other objects compiled for ARMv4t,
> but also allows pure ARMv4 binaries to be built from the same ARMv4 objects.
>
> In the latter case, the switch "--fix-v4bx" must be passed to the
> linker, which causes v4t "BX rM" instructions to be rewritten as "MOV
> PC,rM", since v4 processors do not have a BX instruction.
>
> In the former case, the switch should not be used, and R_ARM_V4BX
> relocations are ignored.
>
> Tested on i686-pc-linux-gnu and arm-none-eabi.
>
> ChangeLog:
>
> * bfd/bin-in.h (bfd_elf32_arm_set_target_relocs): Update
> prototype.
> * bfd/bin-in2.h (bfd_elf32_arm_set_target_relocs): Update
> prototype.
> * bfd/elf32-arm.c (elf32_arm_link_hash_table): Add fix_v4bx
> flag.
> (bfd_elf32_arm_set_target_relocs): Add formal parameter fix_v4bx
> for passing flag value from ld. Set flag value in global hash
> table entry.
> (elf32_arm_final_link_relocate): Add code to implement
> R_ARM_V4BX relocation.
> * ld/emultempl/armelf.em (fix_v4bx): New variable.
> (arm_elf_create_output_section_statements): Communicate fix_v4bx
> flag value to bfd.
> (PARSE_AND_LIST_PROLOGUE): Add option token OPTION_FIX_V4BX.
> (PARSE_AND_LIST_LONGOPTS): Add option --fix-v4bx.
> (PARSE_AND_LIST_OPTIONS): Add option --fix-v4bx.
> (PARSE_AND_LIST_ARGS_CASES): Add option OPTION_FIX_V4BX.
OK.
R.
More information about the Binutils
mailing list