diff options
author | Alan Modra <amodra@gmail.com> | 2021-08-05 14:32:56 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-09-18 08:20:11 +0930 |
commit | 912697efc15768894c13a9370a2fcaa950f24558 (patch) | |
tree | 5f1c97e1870cee187d20fbdbca17d605e18c12e5 /gold/symtab.h | |
parent | 6bc2c6ee80c32462a120927b0a3d1a828769f045 (diff) | |
download | fsf-binutils-gdb-912697efc15768894c13a9370a2fcaa950f24558.zip fsf-binutils-gdb-912697efc15768894c13a9370a2fcaa950f24558.tar.gz fsf-binutils-gdb-912697efc15768894c13a9370a2fcaa950f24558.tar.bz2 |
[GOLD] Got_offset_list: addend field
This is the first in a series of patches aimed at supporting GOT
entries against symbol plus addend generally for PowerPC64 rather than
just section symbol plus addend as gold has currently.
This patch adds an addend field to Got_offset_list, so that both local
and global symbols can have GOT entries with addend.
PR 28192
* object.h (Got_offset_list): Add addend_ field, init in both
constructors. Adjust all accessors to suit.
(Sized_relobj::do_local_has_got_offset): Adjust to suit.
(Sized_relobj::do_local_got_offset): Likewise.
(Sized_relobj::do_set_local_got_offset): Likewise.
* symtab.h (Symbol::has_got_offset): Add optional addend param.
(Symbol::got_offset, Symbol::set_got_offset): Likewise.
* incremental.cc (Local_got_offset_visitor::visit): Add unused
uint64_t parameter with FIXME.
(Global_got_offset_visitor::visit): Add unused uint64_t parameter.
Diffstat (limited to 'gold/symtab.h')
-rw-r--r-- | gold/symtab.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gold/symtab.h b/gold/symtab.h index 104429a..a60cfb9 100644 --- a/gold/symtab.h +++ b/gold/symtab.h @@ -428,22 +428,23 @@ class Symbol // Return whether this symbol has an entry in the GOT section. // For a TLS symbol, this GOT entry will hold its tp-relative offset. bool - has_got_offset(unsigned int got_type) const - { return this->got_offsets_.get_offset(got_type) != -1U; } + has_got_offset(unsigned int got_type, uint64_t addend = 0) const + { return this->got_offsets_.get_offset(got_type, addend) != -1U; } // Return the offset into the GOT section of this symbol. unsigned int - got_offset(unsigned int got_type) const + got_offset(unsigned int got_type, uint64_t addend = 0) const { - unsigned int got_offset = this->got_offsets_.get_offset(got_type); + unsigned int got_offset = this->got_offsets_.get_offset(got_type, addend); gold_assert(got_offset != -1U); return got_offset; } // Set the GOT offset of this symbol. void - set_got_offset(unsigned int got_type, unsigned int got_offset) - { this->got_offsets_.set_offset(got_type, got_offset); } + set_got_offset(unsigned int got_type, unsigned int got_offset, + uint64_t addend = 0) + { this->got_offsets_.set_offset(got_type, got_offset, addend); } // Return the GOT offset list. const Got_offset_list* |