]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Rearrange ppc_size_one_stub and correct _notoc stub examples
authorAlan Modra <amodra@gmail.com>
Wed, 29 Aug 2018 04:41:25 +0000 (14:11 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 31 Aug 2018 12:45:05 +0000 (22:15 +0930)
commitf891966ff66639673a5207b94bd68ec928fb68bc
tree0b61773d0f6c1938dc164e51d2b05121355c47b5
parent4bb3c591b258d12dd0f743e538b7214cbb92ebf7
Rearrange ppc_size_one_stub and correct _notoc stub examples

This patch rearranges ppc_size_one_stub to make it a little easier to
compare against ppc_build_one_stub, and makes a few other random
changes that might help for future maintenance.  There should be no
functional changes here.

The patch also fixes code examples in comments.  A couple of "ori"
instructions lacked the source register operand, and "@high" is the
correct reloc modifier to use in a sequence building a 64-bit value.
(@hi reports overflow of a 32-bit signed value.)

* elf64-ppc.c: Correct _notoc stub comments.
(ppc_build_one_stub): Simplify output of branch for notoc
long branch stub.  Don't include label offset of 8 bytes in
"off" calculation for notoc plt stub.  Don't emit insns to get pc.
(build_offset): Emit insns to get pc here instead.
(size_offset): Add 4 extra insns.
(plt_stub_size): Adjust for "off" and size_offset changes.
(ppc_size_one_stub): Rearrange code into a switch, duplicating
some to better match ppc_build_one_stub.
bfd/ChangeLog
bfd/elf64-ppc.c