aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2015-06-01 15:41:54 +0100
committerJiong Wang <jiong.wang@arm.com>2015-06-01 15:41:54 +0100
commit3d715ce4202ef799e288261d08a5438c82e7c21e (patch)
tree204d5430a5b7e78fac9b7ed5fddf6a4c1dcbf77c /bfd
parente0619de699ae6e86d8b93fa96a7668aef2e9636a (diff)
downloadfsf-binutils-gdb-3d715ce4202ef799e288261d08a5438c82e7c21e.zip
fsf-binutils-gdb-3d715ce4202ef799e288261d08a5438c82e7c21e.tar.gz
fsf-binutils-gdb-3d715ce4202ef799e288261d08a5438c82e7c21e.tar.bz2
[AArch64] GAS support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14
This patch add BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 support in Gas. The relocation modifier === :gotpage_lo14:symbol 2015-06-01 Jiong.Wang <jiong.wang@arm.com> bfd/ * reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14. gas/ * config/tc-aarch64.c (reloc_table): New relocation modifiers. (md_apply_fix): Support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14. (aarch64_force_relocation): Ditto. gas/testsuite/ * gas/aarch64/ilp32-basic.s: New testcase. * gas/aarch64/ilp32-basic.d: Ditto.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/bfd-in2.h3
-rw-r--r--bfd/elfnn-aarch64.c16
-rw-r--r--bfd/libbfd.h1
-rw-r--r--bfd/reloc.c4
5 files changed, 32 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 678f0cc..e1ce381 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,13 @@
2015-06-01 Jiong Wang <jiong.wang@arm.com>
+ * reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+ * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
+ BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
+
+2015-06-01 Jiong Wang <jiong.wang@arm.com>
+
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Set overflow type to
complain_overflow_unsigned for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Don't use
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 804820e..09331bd 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -5737,6 +5737,9 @@ 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,
+/* Scaled 14 bit byte offset to the page base of the global offset table. */
+ BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
+
/* Scaled 15 bit byte offset to the page base of the global offset table. */
BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 26f20c5..3104de7 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -848,6 +848,22 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
0xffc, /* 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 */
+ 2, /* 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 (LD32_GOTPAGE_LO14), /* name */
+ FALSE, /* partial_inplace */
+ 0x5ffc, /* src_mask */
+ 0x5ffc, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
/* LD64: GOT offset to the page address of GOT table.
(G(S) - PAGE (_GLOBAL_OFFSET_TABLE_)) & 0x7ff8. */
HOWTO64 (AARCH64_R (LD64_GOTPAGE_LO15), /* type */
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 73a5803..b2a0979 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_LD32_GOTPAGE_LO14",
"BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15",
"BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21",
"BFD_RELOC_AARCH64_TLSGD_ADR_PREL21",
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 4ee384f..7f2b31e 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -6762,6 +6762,10 @@ 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_LD32_GOTPAGE_LO14
+ENUMDOC
+ Scaled 14 bit byte offset to the page base of the global offset table.
+ENUM
BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15
ENUMDOC
Scaled 15 bit byte offset to the page base of the global offset table.