aboutsummaryrefslogtreecommitdiff
path: root/gold/s390.cc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-08-25 21:58:51 +0930
committerAlan Modra <amodra@gmail.com>2021-09-18 08:20:11 +0930
commite4d49a0f908415edb7a7e718ef2008a96dd43f9b (patch)
treeb23f491455f9e03d32f806cd26590414f4259b73 /gold/s390.cc
parent2cc9ed14fae1b288bbdbd9b102b2cbc9a29bf348 (diff)
downloadfsf-binutils-gdb-e4d49a0f908415edb7a7e718ef2008a96dd43f9b.zip
fsf-binutils-gdb-e4d49a0f908415edb7a7e718ef2008a96dd43f9b.tar.gz
fsf-binutils-gdb-e4d49a0f908415edb7a7e718ef2008a96dd43f9b.tar.bz2
[GOLD] Got_entry::write addends
This takes care of writing out GOT entries with addends. The local symbol case was already largely handled, except for passing the addend to tls_offset_for_local which might need the addend in a local_got_offset call. That's needed also in tls_offset_for_global. I'm assuming here that GOT entries for function symbols won't ever have addends, and in particular that a GOT entry referencing PLT call stub code won't want an offset into the code. PR 28192 * output.cc (Output_data_got::Got_entry::write): Include addend in global symbol value. Pass addend to tls_offset_for_*. * powerpc.cc (Target_powerpc::do_tls_offset_for_local): Handle addend. (Target_powerpc::do_tls_offset_for_global): Likewise. * s390.cc (Target_s390::do_tls_offset_for_local): Likewise. (Target_s390::do_tls_offset_for_global): Likewise. * target.h (Target::tls_offset_for_local): Add addend param. (Target::tls_offset_for_global): Likewise. (Target::do_tls_offset_for_local): Likewise. (Target::do_tls_offset_for_global): Likewise.
Diffstat (limited to 'gold/s390.cc')
-rw-r--r--gold/s390.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/gold/s390.cc b/gold/s390.cc
index 600e708..3095320 100644
--- a/gold/s390.cc
+++ b/gold/s390.cc
@@ -401,12 +401,14 @@ class Target_s390 : public Sized_target<size, true>
int64_t
do_tls_offset_for_local(const Relobj* object,
unsigned int symndx,
- unsigned int got_indx) const;
+ unsigned int got_indx,
+ uint64_t addend) const;
// Return the offset to use for the GOT_INDX'th got entry which is
// for global tls symbol GSYM.
int64_t
- do_tls_offset_for_global(Symbol* gsym, unsigned int got_indx) const;
+ do_tls_offset_for_global(Symbol* gsym, unsigned int got_indx,
+ uint64_t addend) const;
// This function should be defined in targets that can use relocation
// types to determine (implemented in local_reloc_may_be_function_pointer
@@ -4218,7 +4220,8 @@ int64_t
Target_s390<size>::do_tls_offset_for_local(
const Relobj*,
unsigned int,
- unsigned int) const
+ unsigned int,
+ uint64_t) const
{
// The only way we can get called is when IEENT/GOTIE12/GOTIE20
// couldn't be optimised to LE.
@@ -4232,7 +4235,8 @@ template<int size>
int64_t
Target_s390<size>::do_tls_offset_for_global(
Symbol*,
- unsigned int) const
+ unsigned int,
+ uint64_t) const
{
Output_segment* tls_segment = layout_->tls_segment();
return -tls_segment->memsz();