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/target.h | |
parent | a19da04b3c3a01699aaf7a59b03f5f008355b23d (diff) | |
download | gdb-f19c3684a6db145f57048bff5485fec6e3dd0f76.zip gdb-f19c3684a6db145f57048bff5485fec6e3dd0f76.tar.gz 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/target.h')
-rw-r--r-- | gold/target.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gold/target.h b/gold/target.h index 4fce9fd..b9a27d5 100644 --- a/gold/target.h +++ b/gold/target.h @@ -289,16 +289,19 @@ class Target int64_t tls_offset_for_local(const Relobj* object, unsigned int symndx, + Output_data_got_base* got, unsigned int got_indx, uint64_t addend) const - { return do_tls_offset_for_local(object, symndx, got_indx, addend); } + { return do_tls_offset_for_local(object, symndx, got, got_indx, addend); } // Return the offset to use for the GOT_INDX'th got entry which is // for global tls symbol GSYM. int64_t - tls_offset_for_global(Symbol* gsym, unsigned int got_indx, + tls_offset_for_global(Symbol* gsym, + Output_data_got_base* got, + unsigned int got_indx, uint64_t addend) const - { return do_tls_offset_for_global(gsym, got_indx, addend); } + { return do_tls_offset_for_global(gsym, got, got_indx, addend); } // For targets that use function descriptors, if LOC is the location // of a function, modify it to point at the function entry location. @@ -650,12 +653,14 @@ class Target { gold_unreachable(); } virtual int64_t - do_tls_offset_for_local(const Relobj*, unsigned int, unsigned int, + do_tls_offset_for_local(const Relobj*, unsigned int, + Output_data_got_base*, unsigned int, uint64_t) const { gold_unreachable(); } virtual int64_t - do_tls_offset_for_global(Symbol*, unsigned int, uint64_t) const + do_tls_offset_for_global(Symbol*, Output_data_got_base*, unsigned int, + uint64_t) const { gold_unreachable(); } virtual void |