]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[GOLD] PowerPC64 TOC indirect to TOC relative code editing
authorAlan Modra <amodra@gmail.com>
Tue, 10 Jan 2017 21:11:53 +0000 (07:41 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 10 Jan 2017 21:22:53 +0000 (07:52 +1030)
commita5e01c9b1575048f8dce1125e6e889c794da120b
treecd55fa2ccfcb40991e86a9d41b8893b449bfb8ee
parent89b5ab2c42c8a3eac3eb91746c6e86133b9b97ad
[GOLD] PowerPC64 TOC indirect to TOC relative code editing

Doesn't yet trim off the unused TOC entries.

* powerpc.cc (class Powerpc_copy_relocs): New.
(Powerpc_copy_relocs::emit): New function.
(Powerpc_relobj::relatoc_, toc_, no_toc_opt_): New variables.
(Powerpc_relobj::toc_shndx, set_no_toc_opt, no_toc_opt): New inlines.
(Powerpc_relobj::do_relocate_sections): New function.
(Powerpc_relobj::make_toc_relative): Likewise.
(Powerpc_relobj::do_find_special_sections): Stash away .rela.toc
and .toc too.
(ok_lo_toc_insn): Move earlier, and handle more insns.
(Target_powerpc::Scan::local): If optimizing toc accesses, set
no_toc_opt for entries we can't edit.  Check insn validity.
Emit "toc optimization is not supported" warning, downgraded
from error.
(Target_powerpc::Scan::global): Likewise.
(Target_powerpc::Relocate::relocate): Edit TOC indirect code
to TOC relative.  Don't emit "toc optimization is not supported"
error here.
gold/ChangeLog
gold/powerpc.cc