From 87f5fbcc7aa49cee13e9ed44587b80d695d7e781 Mon Sep 17 00:00:00 2001 From: Renlin Li Date: Mon, 15 Jun 2015 11:07:37 +0100 Subject: [AArch64] Gas add BFD_RELOC_AARCH64_LD64_GOTOFF_LO15 support 2015-06-15 Renlin Li bfd/ * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): New entry. * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for BFD_RELOC_AARCH64_LD64_GOTOFF_LO15. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas/ * config/tc-aarch64.c (reloc_table): New relocation modifier. (md_apply_fix): Support BFD_RELOC_AARCH64_LD64_GOTOFF_LO15. (aarch64_force_relocation): Ditto gas/testsuite/ * gas/aarch64/reloc-insn.s: Update test * gas/aarch64/reloc-insn.d: Update expected result. --- bfd/ChangeLog | 8 ++++++++ bfd/bfd-in2.h | 4 ++++ bfd/elfnn-aarch64.c | 15 +++++++++++++++ bfd/libbfd.h | 1 + bfd/reloc.c | 5 +++++ 5 files changed, 33 insertions(+) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5aaa45e..ef760d1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2015-06-15 Renlin Li + + * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): New entry. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15. + 2015-06-15 Alan Modra * cofflink.c (_bfd_coff_generic_relocate_section): Revert diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 09331bd..60b7a24 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -5737,6 +5737,10 @@ the GOT entry for this symbol. Used in conjunction with BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in ILP32 ABI only. */ BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in ILP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, + /* Scaled 14 bit byte offset to the page base of the global offset table. */ BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 4065dfc..1c55058 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -848,6 +848,21 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 0xffc, /* dst_mask */ FALSE), /* pcrel_offset */ + /* LD64: GOT offset for the symbol. */ + HOWTO64 (AARCH64_R (LD64_GOTOFF_LO15), /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (LD64_GOTOFF_LO15), /* name */ + FALSE, /* partial_inplace */ + 0x7ff8, /* src_mask */ + 0x7ff8, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* LD32: GOT offset to the page address of GOT table. (G(S) - PAGE (_GLOBAL_OFFSET_TABLE_)) & 0x5ffc. */ HOWTO32 (AARCH64_R (LD32_GOTPAGE_LO14), /* type */ diff --git a/bfd/libbfd.h b/bfd/libbfd.h index b2a0979..711f08f 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -2733,6 +2733,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AARCH64_ADR_GOT_PAGE", "BFD_RELOC_AARCH64_LD64_GOT_LO12_NC", "BFD_RELOC_AARCH64_LD32_GOT_LO12_NC", + "BFD_RELOC_AARCH64_LD64_GOTOFF_LO15", "BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14", "BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15", "BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21", diff --git a/bfd/reloc.c b/bfd/reloc.c index 7f2b31e..d312e48 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -6762,6 +6762,11 @@ ENUMDOC the GOT entry for this symbol. Used in conjunction with BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in ILP32 ABI only. ENUM + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15 +ENUMDOC + Unsigned 15 bit byte offset for 64 bit load/store from the page of + the GOT entry for this symbol. Valid in ILP64 ABI only. +ENUM BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 ENUMDOC Scaled 14 bit byte offset to the page base of the global offset table. -- cgit v1.1