[AArch64] Create .got section if _GLOBAL_OFFSET_TABLE_ referenced

Jiong Wang jiong.wang@foss.arm.com
Thu Feb 25 11:58:00 GMT 2016


If a relocation refers to _GLOBAL_OFFSET_TABLE_, we should always create
the .got.  Otherwise, _GLOBAL_OFFSET_TABLE_ which implicitly points to
the start of .got section can't be resolved in some rare but do exist
scenarios (ppc32 seems has the same issue and have done the same fix).

ld regression OK on both cross and native environment.

OK for master?

2016-02-25  Jiong Wang  <jiong.wang@arm.com>

bfd/
   * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Always create .got section if
   symbol _GLOBAL_OFFSET_TABLE_ referenced.

ld/testsuite/
   * ld-aarch64/implicit_got_section_1.s: New test source file.
   * ld-aarch64/implicit_got_section_1.d: New test expected result.
   * ld-aarch64/aarch64-elf.exp: Run new test.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: got.patch
Type: text/x-patch
Size: 2171 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160225/1e0efeb9/attachment.bin>


More information about the Binutils mailing list