diff options
author | Alan Modra <amodra@gmail.com> | 2020-10-09 16:56:33 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-10-09 23:24:17 +1030 |
commit | fa40fbe484954c560ab1c0ff4bc1b2eeb1511344 (patch) | |
tree | 2e6af9068d974acf0b43a502398d069bbe23f0ec /gold/cref.h | |
parent | 4290b0ab2b65db23afc9bd8177885bfd91911c0c (diff) | |
download | gdb-fa40fbe484954c560ab1c0ff4bc1b2eeb1511344.zip gdb-fa40fbe484954c560ab1c0ff4bc1b2eeb1511344.tar.gz gdb-fa40fbe484954c560ab1c0ff4bc1b2eeb1511344.tar.bz2 |
[GOLD] Power10 segv due to wild r2
Calling non-pcrel functions from pcrel code requires a stub to set up
r2. Gold created the stub, but an "optimisation" made the stub jump
to the function local entry, ie. r2 was not initialised.
This patch fixes that long branch stub problem, and another that might
occur for plt call stubs to local functions.
bfd/
* elf64-ppc.c (write_plt_relocs_for_local_syms): Don't do local
entry offset optimisation.
gold/
* powerpc.cc (Powerpc_relobj::do_relocate_sections): Don't do
local entry offset optimisation for lplt_section.
(Target_powerpc::Branch_info::make_stub): Don't add local
entry offset to long branch dest passed to
add_long_branch_entry. Do pass st_other bits.
(Stub_table::Branch_stub_ent): Add "other_" field.
(Stub_table::add_long_branch_entry): Add "other" param, and
save.
(Stub_table::branch_stub_size): Adjust long branch offset.
(Stub_table::do_write): Likewise.
(Target_powerpc::Relocate::relocate): Likewise.
Diffstat (limited to 'gold/cref.h')
0 files changed, 0 insertions, 0 deletions