[4/16][binutils][AARCH64]Add relocation support for large memory model. [LD]Add BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC Support.

Renlin Li renlin.li@arm.com
Tue Sep 8 16:23:00 GMT 2015


Hi all,

This patch add BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC to binutils linker.

It's used in large memory model, GOT PIC addressing.
For the large model and -fPIC, the GOT is limited to 4GB, allowing it to 
be accessed using a 32-bit unsigned register index.

// gp = &_GOT_
movz t0, #:gotoff_g1:src // R_AARCH64_MOVW_GOTOFF_G1 src
movk t0, #:gotoff_g0_nc:src // R_AARCH64_MOVW_GOTOFF_G0_NC src
ldr     t0, [gp, t0]


LD tests Okay without any issues. Okay to commit?

bfd/ChangeLog:

2015-09-08  Renlin Li  <renlin.li@arm.com>

     * elfnn-aarch64.c (aarch64_reloc_got_type): Add
         BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC support.
     (elfNN_aarch64_final_link_relocate): Likewise.
     (elfNN_aarch64_relocate_section): Likewise.
     (elfNN_aarch64_gc_sweep_hook): Likewise.
     (elfNN_aarch64_check_relocs): Likewise.
     * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
     (_bfd_aarch64_elf_resolve_relocation): Likewise.

ld/testsuite/ChangeLog:

2015-09-08  Renlin Li  <renlin.li@arm.com>

     * ld-aarch64/emit-relocs-516.d: New.
     * ld-aarch64/emit-relocs-516.s: New.
     * ld-aarch64/aarch64-elf.exp: Run new test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-LD-BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.patch
Type: text/x-patch
Size: 5621 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150908/22338431/attachment.bin>


More information about the Binutils mailing list