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/incremental.cc | |
parent | 6bc2c6ee80c32462a120927b0a3d1a828769f045 (diff) | |
download | gdb-912697efc15768894c13a9370a2fcaa950f24558.zip gdb-912697efc15768894c13a9370a2fcaa950f24558.tar.gz 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/incremental.cc')
-rw-r--r-- | gold/incremental.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gold/incremental.cc b/gold/incremental.cc index ab258dd..5294198 100644 --- a/gold/incremental.cc +++ b/gold/incremental.cc @@ -1848,7 +1848,7 @@ class Local_got_offset_visitor : public Got_offset_list::Visitor { } void - visit(unsigned int got_type, unsigned int got_offset) + visit(unsigned int got_type, unsigned int got_offset, uint64_t) { unsigned int got_index = got_offset / this->info_.got_entry_size; gold_assert(got_index < this->info_.got_count); @@ -1860,6 +1860,12 @@ class Local_got_offset_visitor : public Got_offset_list::Visitor unsigned char* pov = this->info_.got_desc_p + got_index * 8; elfcpp::Swap<32, big_endian>::writeval(pov, this->info_.sym_index); elfcpp::Swap<32, big_endian>::writeval(pov + 4, this->info_.input_index); + // FIXME: the uint64_t addend should be written here if powerpc64 + // sym+addend got entries are to be supported, with similar changes + // to Global_got_offset_visitor and support to read them back in + // do_process_got_plt. + // FIXME: don't we need this for section symbol plus addend anyway? + // (See 2015-12-03 commit 7ef8ae7c5f35) } private: @@ -1879,7 +1885,7 @@ class Global_got_offset_visitor : public Got_offset_list::Visitor { } void - visit(unsigned int got_type, unsigned int got_offset) + visit(unsigned int got_type, unsigned int got_offset, uint64_t) { unsigned int got_index = got_offset / this->info_.got_entry_size; gold_assert(got_index < this->info_.got_count); |