]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[GOLD] Got_entry::write addends
authorAlan Modra <amodra@gmail.com>
Wed, 25 Aug 2021 12:28:51 +0000 (21:58 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 30 Sep 2021 00:46:27 +0000 (10:16 +0930)
commitf8069e2ccf9f25e2cccb09dd02d924d3cace9391
tree341840535cc6e41477e430efa9c38dfc84662f08
parent60c49a5eee170026a9cd03e64388993f2e79985b
[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.

(cherry picked from commit e4d49a0f908415edb7a7e718ef2008a96dd43f9b)
gold/output.cc
gold/powerpc.cc
gold/s390.cc
gold/target.h