summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHan Shen <shenhan@google.com>2015-11-21 00:14:46 (GMT)
committerHan Shen <shenhan@google.com>2015-11-21 00:17:53 (GMT)
commitc536bde99270a2aead0dd1255f7bfb8458bdaa93 (patch)
treebc6605df449d33c67e50dfc0a0aca5a300d3c512
parent8bfb6b2bf11cfbc445239158ec28d0988f8fa947 (diff)
downloadtoolchain_binutils-c536bde99270a2aead0dd1255f7bfb8458bdaa93.zip
toolchain_binutils-c536bde99270a2aead0dd1255f7bfb8458bdaa93.tar.gz
toolchain_binutils-c536bde99270a2aead0dd1255f7bfb8458bdaa93.tar.bz2
Cherry pick upstream patch for aarch64 unsupported reloc.
Bug entry here - https://b.corp.google.com/u/0/issues/25642296 Tested: ./build.py --host "linux" --toolchain aarch64-linux-android Upstream patch here - commit 4d2f5d5824be99326c2c3e459c298e338856d8c8 Author: Han Shen <shenhan@google.com> Date: Tue Oct 27 15:17:54 2015 -0700 Patch for PR gold/19042 - unsupported reloc 311/312. gold/ * aarch64.cc (Target_aarch64::Scan::local): Add support for reloc 311/312. Change-Id: If784460c1ebdfb2be1ebdf1486db5eb03c5240a5
-rw-r--r--binutils-2.25/gold/ChangeLog7
-rw-r--r--binutils-2.25/gold/aarch64.cc23
2 files changed, 30 insertions, 0 deletions
diff --git a/binutils-2.25/gold/ChangeLog b/binutils-2.25/gold/ChangeLog
index 9608cc0..24e8755 100644
--- a/binutils-2.25/gold/ChangeLog
+++ b/binutils-2.25/gold/ChangeLog
@@ -1,3 +1,10 @@
+2015-10.27 Han Shen <shenhan@google.com>
+
+ PR gold/19042 - unsupported reloc 311/312.
+
+ * aarch64.cc (Target_aarch64::Scan::local): Add support for
+ reloc 311/312.
+
2015-01-02 Alan Modra <amodra@gmail.com>
* version.cc (print_version): Just print current year.
diff --git a/binutils-2.25/gold/aarch64.cc b/binutils-2.25/gold/aarch64.cc
index 4153389..1148bf7 100644
--- a/binutils-2.25/gold/aarch64.cc
+++ b/binutils-2.25/gold/aarch64.cc
@@ -5987,6 +5987,29 @@ Target_aarch64<size, big_endian>::Scan::local(
case elfcpp::R_AARCH64_PREL16:
break;
+ case elfcpp::R_AARCH64_ADR_GOT_PAGE:
+ case elfcpp::R_AARCH64_LD64_GOT_LO12_NC:
+ // This pair of relocations is used to access a specific GOT entry.
+ {
+ bool is_new = false;
+ // This symbol requires a GOT entry.
+ if (is_ifunc)
+ is_new = got->add_local_plt(object, r_sym, GOT_TYPE_STANDARD);
+ else
+ is_new = got->add_local(object, r_sym, GOT_TYPE_STANDARD);
+ if (is_new && parameters->options().output_is_position_independent())
+ target->rela_dyn_section(layout)->
+ add_local_relative(object,
+ r_sym,
+ elfcpp::R_AARCH64_RELATIVE,
+ got,
+ object->local_got_offset(r_sym,
+ GOT_TYPE_STANDARD),
+ 0,
+ false);
+ }
+ break;
+
case elfcpp::R_AARCH64_LD_PREL_LO19: // 273
case elfcpp::R_AARCH64_ADR_PREL_LO21: // 274
case elfcpp::R_AARCH64_ADR_PREL_PG_HI21: // 275