aboutsummaryrefslogtreecommitdiff
path: root/gold/aarch64.cc
diff options
context:
space:
mode:
authorEgeyar Bagcioglu <egeyar.bagcioglu@oracle.com>2019-02-19 16:12:44 -0800
committerCary Coutant <ccoutant@gmail.com>2019-02-19 16:13:24 -0800
commit7ae39e2d406dbec568c5ffd462119037b994fdf9 (patch)
tree8f6e921deb682b55a758a42f3305a8cb1cc29bd3 /gold/aarch64.cc
parentabaeb1562648d4b58497040a20d772bd08c06d4b (diff)
downloadgdb-7ae39e2d406dbec568c5ffd462119037b994fdf9.zip
gdb-7ae39e2d406dbec568c5ffd462119037b994fdf9.tar.gz
gdb-7ae39e2d406dbec568c5ffd462119037b994fdf9.tar.bz2
Check whether symbols with MOVW_.ABS relocations require PLT entries (aarch64).
2019-02-19 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com> gold/ PR gold/23870 * aarch64.cc (Target_aarch64::Scan::global): Check if a symbol with R_AARCH64_MOVW_.ABS_* relocations requires a PLT entry. * testsuite/Makefile.am: Add aarch64_pr23870 test case. * testsuite/Makefile.in: Regenerate. * testsuite/aarch64_pr23870_bar.c: New file. * testsuite/aarch64_pr23870_foo.c: New file. * testsuite/aarch64_pr23870_main.S: New file.
Diffstat (limited to 'gold/aarch64.cc')
-rw-r--r--gold/aarch64.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index bb98edc..a45d3fd 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -6496,6 +6496,17 @@ Target_aarch64<size, big_endian>::Scan::global(
gold_error(_("%s: unsupported reloc %u in pos independent link."),
object->name().c_str(), r_type);
}
+ // Make a PLT entry if necessary.
+ if (gsym->needs_plt_entry())
+ {
+ target->make_plt_entry(symtab, layout, gsym);
+ // Since this is not a PC-relative relocation, we may be
+ // taking the address of a function. In that case we need to
+ // set the entry in the dynamic symbol table to the address of
+ // the PLT entry.
+ if (gsym->is_from_dynobj() && !parameters->options().shared())
+ gsym->set_needs_dynsym_value();
+ }
break;
case elfcpp::R_AARCH64_LD_PREL_LO19: // 273