[6/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 17:51:00 GMT 2015


Hi all,

This patch adds BFD_RELOC_AARCH64_MOVW_GOTOFF_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?
Regards,
Renlin Li


bfd/ChangeLog:

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

     * elfnn-aarch64.c (aarch64_reloc_got_type): Add
         BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC support.
     (elfNN_aarch64_final_link_relocate): 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/aarch64-elf.exp: Run new test.
     * ld-aarch64/emit-relocs-301.d: New.
     * ld-aarch64/emit-relocs-301.s: New.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-LD-BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC.patch
Type: text/x-patch
Size: 5641 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150908/ae5c68e3/attachment.bin>


More information about the Binutils mailing list