aboutsummaryrefslogtreecommitdiff
path: root/gold/aarch64.cc
diff options
context:
space:
mode:
authorHan Shen <shenhan@google.com>2016-05-06 15:07:13 -0700
committerHan Shen <shenhan@google.com>2016-05-09 14:22:15 -0700
commit5c28a5038108d75652e1ee9753aa2f1ffe8176db (patch)
treeb01d81c1dfa2ec2635f6d15d83e6df2e77dfbc0a /gold/aarch64.cc
parent315350be6598235df12a0190a5a4c21447eead36 (diff)
downloadgdb-5c28a5038108d75652e1ee9753aa2f1ffe8176db.zip
gdb-5c28a5038108d75652e1ee9753aa2f1ffe8176db.tar.gz
gdb-5c28a5038108d75652e1ee9753aa2f1ffe8176db.tar.bz2
Fix for PR gold/19987.
Diffstat (limited to 'gold/aarch64.cc')
-rw-r--r--gold/aarch64.cc23
1 files changed, 19 insertions, 4 deletions
diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index 01868c7..75e4177 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -5106,6 +5106,8 @@ class AArch64_relocate_functions
static_cast<Valtype>(val | (immed << doffset)));
}
+ public:
+
// Update selected bits in text.
template<int valsize>
@@ -5133,8 +5135,6 @@ class AArch64_relocate_functions
: This::STATUS_OVERFLOW);
}
- public:
-
// Construct a B insn. Note, although we group it here with other relocation
// operation, there is actually no 'relocation' involved here.
static inline void
@@ -6001,7 +6001,8 @@ Target_aarch64<size, big_endian>::Scan::local(
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.
+ case elfcpp::R_AARCH64_LD64_GOTPAGE_LO15:
+ // The above relocations are used to access GOT entries.
{
bool is_new = false;
// This symbol requires a GOT entry.
@@ -6326,8 +6327,9 @@ Target_aarch64<size, big_endian>::Scan::global(
case elfcpp::R_AARCH64_ADR_GOT_PAGE:
case elfcpp::R_AARCH64_LD64_GOT_LO12_NC:
+ case elfcpp::R_AARCH64_LD64_GOTPAGE_LO15:
{
- // This pair of relocations is used to access a specific GOT entry.
+ // The above relocations are used to access GOT entries.
// Note a GOT entry is an *address* to a symbol.
// The symbol requires a GOT entry
Output_data_got_aarch64<size, big_endian>* got =
@@ -7045,6 +7047,19 @@ Target_aarch64<size, big_endian>::Relocate::relocate(
view, value, addend, reloc_property);
break;
+ case elfcpp::R_AARCH64_LD64_GOTPAGE_LO15:
+ {
+ gold_assert(have_got_offset);
+ value = target->got_->address() + got_base + got_offset + addend -
+ Reloc::Page(target->got_->address() + got_base);
+ if ((value & 7) != 0)
+ reloc_status = Reloc::STATUS_OVERFLOW;
+ else
+ reloc_status = Reloc::template reloc_common<32>(
+ view, value, reloc_property);
+ break;
+ }
+
case elfcpp::R_AARCH64_TLSGD_ADR_PAGE21:
case elfcpp::R_AARCH64_TLSGD_ADD_LO12_NC:
case elfcpp::R_AARCH64_TLSLD_ADR_PAGE21: