[AArch64] Relax long branch veneer insertion for non STT_FUNC symbol

Jiong Wang jiong.wang@foss.arm.com
Fri Jan 15 16:13:00 GMT 2016


As defined at AArch64 ELF Specification (4.6.7 Call and Jump
relocations), symbol with type of non STT_FUNC but in different input
section with relocation place should insert long branch veneer also.

Meanwhile the current long branch veneer infrastructure havn't considered
the situation where the branch destination is "sym_value + rela->addend".

This was OK because we only insert veneer for long call destination is
STT_FUNC symbol, so the addend is always zero. But as we relax the support
to other situations by this patch, we need to handle addend be non-zero
value. For example, for static function, relocation against "local symbol"
are turned into relocation against "section symbol + offset" where there is
a valid addend.

OK for master?

2016-01-15  Jiong Wang  <jiong.wang@arm.com>

bfd/
   (aarch64_type_of_stub): Allow insert long branch veneer for
   sym_sec != input_sec.
   (elfNN_aarch64_size_stub): Support STT_SECTION symbol.
   (elfNN_aarch64_final_link_relocate): Take rela addend into account
   when calculation destination.


ld/testsuite/
   * ld-aarch64/farcall-section.d: Delete.
   * ld-aarch64/farcall-section.s: Delete.
   * ld-aarch64/farcall-b-section.d: New expectation file.
   * ld-aarch64/farcall-bl-section.d: Likewise.
   * ld-aarch64/farcall-b-section.s: New testcase.
   * ld-aarch64/farcall-bl-section.s: Likewise.
   * ld-aarch64/aarch64-elf.exp: Likewise.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: veneer.patch
Type: text/x-patch
Size: 8696 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160115/7f8d39b6/attachment.bin>


More information about the Binutils mailing list