|
|
@ -5192,12 +5192,14 @@ my_func:
|
|
|
|
</para>
|
|
|
|
</para>
|
|
|
|
<para revisionflag="added">R_PPC64_PCREL_OPT</para>
|
|
|
|
<para revisionflag="added">R_PPC64_PCREL_OPT</para>
|
|
|
|
<para revisionflag="added">
|
|
|
|
<para revisionflag="added">
|
|
|
|
This relocation type requests that the annotated
|
|
|
|
This relocation specifies that the instruction at r_offset and the
|
|
|
|
instruction and its immediately following instruction be optimized by
|
|
|
|
instruction at <emphasis>r_offset</emphasis> +
|
|
|
|
the linker when the referenced symbol can be statically resolved,
|
|
|
|
<emphasis>r_addend</emphasis> may be optimized by the linker.
|
|
|
|
or when a more efficient PC-relative sequence can be chosen.
|
|
|
|
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 <xref linkend="dbdoclet.50655241_OptPCRel" /> and
|
|
|
|
See <xref linkend="dbdoclet.50655241_OptPCRel" /> and
|
|
|
|
<xref linkend="dbdoclet.50655241_OptMask" /> for details.
|
|
|
|
<xref linkend="dbdoclet.50655241_OptMask" /> for more details.
|
|
|
|
</para>
|
|
|
|
</para>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section>
|
|
|
@ -5351,18 +5353,19 @@ target:
|
|
|
|
For example:
|
|
|
|
For example:
|
|
|
|
</para>
|
|
|
|
</para>
|
|
|
|
<programlisting>pld r10, symbol@got@pcrel
|
|
|
|
<programlisting>pld r10, symbol@got@pcrel
|
|
|
|
lvx v1, 0, r10</programlisting>
|
|
|
|
lxv vs1, 0(r10)</programlisting>
|
|
|
|
<para>The previous sequence may be replaced by:</para>
|
|
|
|
<para>The previous sequence may be replaced by:</para>
|
|
|
|
<programlisting>plxv v1, symbol@pcrel
|
|
|
|
<programlisting>plxv vs1, symbol@pcrel
|
|
|
|
nop</programlisting>
|
|
|
|
nop</programlisting>
|
|
|
|
<para>
|
|
|
|
<para>
|
|
|
|
However, this optimization is not universally safe, since it
|
|
|
|
However, this optimization is not universally safe, since it
|
|
|
|
changes the value of r10 following the data reference. The
|
|
|
|
changes the value of r10 following the data reference. The
|
|
|
|
compiler or programmer must ensure that the value of r10 is not
|
|
|
|
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
|
|
|
|
by placing an R_PPC64_PCREL_OPT relocation on the first instruction
|
|
|
|
in the sequence. The compiler or programmer must further ensure that
|
|
|
|
in the sequence that provides the offset to the second instruction
|
|
|
|
the two instructions are not separated by intervening instructions.
|
|
|
|
in the sequence.
|
|
|
|
</para>
|
|
|
|
</para>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
<section xml:id="dbdoclet.50655241_OptMask" revisionflag="added">
|
|
|
|
<section xml:id="dbdoclet.50655241_OptMask" revisionflag="added">
|
|
|
@ -5376,10 +5379,10 @@ nop</programlisting>
|
|
|
|
that can be optimized by a linker. For example:
|
|
|
|
that can be optimized by a linker. For example:
|
|
|
|
</para>
|
|
|
|
</para>
|
|
|
|
<programlisting>paddi r10,symbol@pcrel
|
|
|
|
<programlisting>paddi r10,symbol@pcrel
|
|
|
|
pmlxvx v1,r9,r10,VRM,MC,P,0</programlisting>
|
|
|
|
pmlxv vs1,0(r10),VRM,MC,P,0</programlisting>
|
|
|
|
<para>The previous sequence may be replaced by:</para>
|
|
|
|
<para>The previous sequence may be replaced by:</para>
|
|
|
|
<programlisting>dnop
|
|
|
|
<programlisting>dnop
|
|
|
|
pmlxv v1,symbol@pcrel(r9),VRM,MC,P,1</programlisting>
|
|
|
|
pmlxv vs1,symbol@pcrel(r0),VRM,MC,P,1</programlisting>
|
|
|
|
<para>
|
|
|
|
<para>
|
|
|
|
when the linker determines that the offset from the current
|
|
|
|
when the linker determines that the offset from the current
|
|
|
|
instruction address to symbol's address will fit in 28 bits.
|
|
|
|
instruction address to symbol's address will fit in 28 bits.
|
|
|
@ -5387,11 +5390,12 @@ pmlxv v1,symbol@pcrel(r9),VRM,MC,P,1</programlisting>
|
|
|
|
<para>
|
|
|
|
<para>
|
|
|
|
Again, this optimization is not universally safe, since it changes
|
|
|
|
Again, this optimization is not universally safe, since it changes
|
|
|
|
the value of r10 following the data reference. The compiler or
|
|
|
|
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
|
|
|
|
used, and communicate a request for this optimization by placing
|
|
|
|
an R_PPC64_PCREL_OPT relocation on the first instruction in the
|
|
|
|
an R_PPC64_PCREL_OPT relocation on the first instruction in the
|
|
|
|
sequence. The compiler or programmer must further ensure that the
|
|
|
|
sequence that provides the offset to the second instruction in the
|
|
|
|
two instructions are not separated by intervening instructions.
|
|
|
|
sequence.
|
|
|
|
</para>
|
|
|
|
</para>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|