From 4c46dde1db6609d274e6914e58401cf3e533a227 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Tue, 11 Jun 2019 10:42:00 -0500 Subject: [PATCH] Update language related to R_PPC64_PCREL_OPT usage. --- specification/ch_3.xml | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/specification/ch_3.xml b/specification/ch_3.xml index a39a81e..8c36960 100644 --- a/specification/ch_3.xml +++ b/specification/ch_3.xml @@ -5192,12 +5192,14 @@ my_func: R_PPC64_PCREL_OPT - This relocation type requests that the annotated - instruction and its immediately following instruction be optimized by - the linker when the referenced symbol can be statically resolved, - or when a more efficient PC-relative sequence can be chosen. + This relocation specifies that the instruction at r_offset and the + instruction at r_offset + + r_addend may be optimized by the linker. + Specifically, the register set by the first instruction and used by + the second is not used by any intervening instruction nor is the value + used by any following instruction. See and - for details. + for more details.
@@ -5351,18 +5353,19 @@ target: For example: pld r10, symbol@got@pcrel -lvx v1, 0, r10 +lxv vs1, 0(r10) The previous sequence may be replaced by: - plxv v1, symbol@pcrel + plxv vs1, symbol@pcrel nop However, this optimization is not universally safe, since it changes the value of r10 following the data reference. The compiler or programmer must ensure that the value of r10 is not - subsequently used, and communicate a request for this optimization + used between the two instructions nor subsequently used, + and communicate a request for this optimization by placing an R_PPC64_PCREL_OPT relocation on the first instruction - in the sequence. The compiler or programmer must further ensure that - the two instructions are not separated by intervening instructions. + in the sequence that provides the offset to the second instruction + in the sequence.
@@ -5376,10 +5379,10 @@ nop that can be optimized by a linker. For example: paddi r10,symbol@pcrel -pmlxvx v1,r9,r10,VRM,MC,P,0 +pmlxv vs1,0(r10),VRM,MC,P,0 The previous sequence may be replaced by: dnop -pmlxv v1,symbol@pcrel(r9),VRM,MC,P,1 +pmlxv vs1,symbol@pcrel(r0),VRM,MC,P,1 when the linker determines that the offset from the current instruction address to symbol's address will fit in 28 bits. @@ -5387,11 +5390,12 @@ pmlxv v1,symbol@pcrel(r9),VRM,MC,P,1 Again, this optimization is not universally safe, since it changes the value of r10 following the data reference. The compiler or - programmer must ensure that the value of r10 is not subsequently + programmer must ensure that the value of r10 is not used between + the two instructions nor subsequently used, and communicate a request for this optimization by placing an R_PPC64_PCREL_OPT relocation on the first instruction in the - sequence. The compiler or programmer must further ensure that the - two instructions are not separated by intervening instructions. + sequence that provides the offset to the second instruction in the + sequence.