aboutsummaryrefslogtreecommitdiff
path: root/gold/aarch64.cc
diff options
context:
space:
mode:
authorStephen Crane <sjc@immunant.com>2018-05-10 00:09:32 -0700
committerCary Coutant <ccoutant@gmail.com>2018-05-10 00:13:33 -0700
commita45a8f9178448171b51d9fc80d45ede73e99e399 (patch)
treeebc147bcb7140503515c37d525eb720fddf7425a /gold/aarch64.cc
parent6fe88226c25fa3fdea506538688897272d42822b (diff)
downloadfsf-binutils-gdb-a45a8f9178448171b51d9fc80d45ede73e99e399.zip
fsf-binutils-gdb-a45a8f9178448171b51d9fc80d45ede73e99e399.tar.gz
fsf-binutils-gdb-a45a8f9178448171b51d9fc80d45ede73e99e399.tar.bz2
Fix _GLOBAL_OFFSET_TABLE_ value for large GOTs (aarch64).
Gold resolves GOT-relative relocs relative to the GOT base + 0x8000 when the GOT is larger than 0x8000. However, previously the _GLOBAL_OFFSET_TABLE_ symbol was set to GOT base + 0x8000 when the .got.plt was larger than 0x8000. This patch makes both checks use the size of the .got section so that they agree when to add 0x8000.
Diffstat (limited to 'gold/aarch64.cc')
-rw-r--r--gold/aarch64.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index 8de9a26..67f2108 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -6965,11 +6965,11 @@ Target_aarch64<size, big_endian>::do_finalize_sections(
}
// Set the size of the _GLOBAL_OFFSET_TABLE_ symbol to the size of
- // the .got.plt section.
+ // the .got section.
Symbol* sym = this->global_offset_table_;
if (sym != NULL)
{
- uint64_t data_size = this->got_plt_->current_data_size();
+ uint64_t data_size = this->got_->current_data_size();
symtab->get_sized_symbol<size>(sym)->set_symsize(data_size);
// If the .got section is more than 0x8000 bytes, we add