diff options
author | Alan Modra <amodra@gmail.com> | 2021-10-09 10:03:21 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-10-14 13:08:46 +1030 |
commit | f19c3684a6db145f57048bff5485fec6e3dd0f76 (patch) | |
tree | f9a488503e22d7ecae390a551b5bbadddd0ec52a /gold/output.cc | |
parent | a19da04b3c3a01699aaf7a59b03f5f008355b23d (diff) | |
download | fsf-binutils-gdb-f19c3684a6db145f57048bff5485fec6e3dd0f76.zip fsf-binutils-gdb-f19c3684a6db145f57048bff5485fec6e3dd0f76.tar.gz fsf-binutils-gdb-f19c3684a6db145f57048bff5485fec6e3dd0f76.tar.bz2 |
[GOLD] Two GOT sections for PowerPC64
Split .got into two piece, one with the header and entries for small
model got entries, the other with entries for medium/large model got
entries. The idea is to better support mixed pcrel/non-pcrel code
where non-pcrel small-model .toc entries need to be within 32k of the
toc pointer.
* target.h (Target::tls_offset_for_local): Add got param.
(Target::tls_offset_for_global): Likewise.
(Target::do_tls_offset_for_local, do_tls_offset_for_global): Likewise.
* output.h (Output_data_got::Got_entry::write): Add got param.
* output.cc (Output_data_got::Got_entry::write): Likewise, pass to
tls_offset_for_local/global calls.
(Output_data_got::do_write): Adjust to suit.
* s390.cc (Target_s390::do_tls_offset_for_local): Likewise.
(Target_s390::do_tls_offset_for_global): Likewise.
* powerpc.cc (enum Got_type): Extend with small types, move from
class Target_powerpc.
(Target_powerpc::biggot_): New.
(Traget_powerpc::do_tls_offset_for_local, do_tls_offset_for_global,
got_size, got_section, got_base_offset): Handle biggot_.
(Target_powerpc::do_define_standard_symbols): Adjust.
(Target_powerpc::make_plt_section, do_finalize_sections): Likewise.
(Output_data_got_powerpc::Output_data_got_powerpc): Only make
64-bit header for small got section.
(Output_data_got_powerpc::g_o_t): Only return a result for small
got section.
(Output_data_got_powerpc::write): Only write small got section
header.
(Target_powerpc::Scan::local, global): Select small/big Got_type
and section to suit reloc.
(Target_powerpc::Relocate::relocate): Similarly.
(Sort_toc_sections): Rewrite.
Diffstat (limited to 'gold/output.cc')
-rw-r--r-- | gold/output.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gold/output.cc b/gold/output.cc index 7ad8750..f2890c8 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -1367,6 +1367,7 @@ Output_data_group<size, big_endian>::do_write(Output_file* of) template<int got_size, bool big_endian> void Output_data_got<got_size, big_endian>::Got_entry::write( + Output_data_got_base* got, unsigned int got_indx, unsigned char* pov) const { @@ -1421,7 +1422,7 @@ Output_data_got<got_size, big_endian>::Got_entry::write( if (this->use_plt_or_tls_offset_ && gsym->type() == elfcpp::STT_TLS) val += parameters->target().tls_offset_for_global(gsym, - got_indx, + got, got_indx, this->addend_); } } @@ -1451,7 +1452,7 @@ Output_data_got<got_size, big_endian>::Got_entry::write( val = convert_types<Valtype, uint64_t>(lval); if (this->use_plt_or_tls_offset_ && is_tls) val += parameters->target().tls_offset_for_local(object, lsi, - got_indx, + got, got_indx, this->addend_); } } @@ -1699,7 +1700,7 @@ Output_data_got<got_size, big_endian>::do_write(Output_file* of) unsigned char* pov = oview; for (unsigned int i = 0; i < this->entries_.size(); ++i) { - this->entries_[i].write(i, pov); + this->entries_[i].write(this, i, pov); pov += add; } |