@ -116,8 +116,7 @@ e_ident[EI_DATA] ELFDATA2LSB For all little-endian implementations.</progra
</row>
</row>
<row>
<row>
<entry>
<entry>
<para>.plt
<para>.plt<footnote>
<footnote>
<para>The type of the OpenPOWER ABI .plt section is
<para>The type of the OpenPOWER ABI .plt section is
SHT_NOBITS, not SHT_PROGBITS as on most other processors.</para>
SHT_NOBITS, not SHT_PROGBITS as on most other processors.</para>
</footnote></para>
</footnote></para>
@ -184,7 +183,7 @@ e_ident[EI_DATA] ELFDATA2LSB For all little-endian implementations.</progra
is linker generated. The linker must ensure that .got is aligned to an
is linker generated. The linker must ensure that .got is aligned to an
8-byte boundary. In an executable or shared library, it may contain
8-byte boundary. In an executable or shared library, it may contain
part or all of the TOC. For more information, see
part or all of the TOC. For more information, see
<xref revisionflag='deleted' linkend="dbdoclet.50655240___RefHeading___Toc377640591" /> and
<xref linkend="dbdoclet.50655240___RefHeading___Toc377640591" /> and
<xref linkend="dbdoclet.50655242_47739" />.</para>
<xref linkend="dbdoclet.50655242_47739" />.</para>
</listitem>
</listitem>
<listitem>
<listitem>
@ -319,7 +318,7 @@ e_ident[EI_DATA] ELFDATA2LSB For all little-endian implementations.</progra
pointer can use a common entry point for the local and global
pointer can use a common entry point for the local and global
entry points.</para>
entry points.</para>
<note>
<note>
<para>Note: If the function is not a leaf function, it must
<para>If the function is not a leaf function, it must
call subroutines using the R_PPC64_REL24_NOTOC relocation
call subroutines using the R_PPC64_REL24_NOTOC relocation
to indicate that the TOC register is not initialized. In
to indicate that the TOC register is not initialized. In
turn, this may lead to more expensive procedure linkage
turn, this may lead to more expensive procedure linkage
@ -852,7 +851,7 @@ my_func:
</entry>
</entry>
</row>
</row>
<row>
<row>
<entry align="left">
<entry align="right">
<para>0</para>
<para>0</para>
</entry>
</entry>
<entry>
<entry>
@ -2230,7 +2229,7 @@ my_func:
</entry>
</entry>
<entry>
<entry>
<para>Denotes the high adjusted value: bits 16 - 63 of the
<para>Denotes the high adjusted value: bits 16 - 63 of the
indicated value, compensating for #lo() being treated as a
indicated value, compensating for #lo( ) being treated as a
signed number. That is:</para>
signed number. That is:</para>
<para>#ha(x) = (x + 0x8000) >> 16</para>
<para>#ha(x) = (x + 0x8000) >> 16</para>
</entry>
</entry>
@ -2324,7 +2323,7 @@ my_func:
<para>If n is the offset computed:</para>
<para>If n is the offset computed:</para>
<para>GOT[n] = dtpmod</para>
<para>GOT[n] = dtpmod</para>
<para>GOT[n + 1] = dtprel</para>
<para>GOT[n + 1] = dtprel</para>
<para>The call to __tls_get_addr () happens as:</para>
<para>The call to __tls_get_addr ( ) happens as:</para>
<para>__tls_get_addr ((tls_index *) &GOT[n])</para>
<para>__tls_get_addr ((tls_index *) &GOT[n])</para>
</entry>
</entry>
</row>
</row>
@ -2339,7 +2338,7 @@ my_func:
<para>If n is the offset computed:</para>
<para>If n is the offset computed:</para>
<para>GOT[n] = dtpmod</para>
<para>GOT[n] = dtpmod</para>
<para>GOT[n + 1] = 0</para>
<para>GOT[n + 1] = 0</para>
<para>The call to __tls_get_addr () happens as:</para>
<para>The call to __tls_get_addr ( ) happens as:</para>
<para>__tls_get_addr ((tls_index *) &GOT[n])</para>
<para>__tls_get_addr ((tls_index *) &GOT[n])</para>
</entry>
</entry>
</row>
</row>
@ -2360,7 +2359,7 @@ my_func:
</tgroup>
</tgroup>
</informaltable>
</informaltable>
<note>
<note>
<para>Note: Relocations flagged with an asterisk(*) will
<para>Relocations flagged with an asterisk(*) will
trigger a relocation failure if the value computed does
trigger a relocation failure if the value computed does
not fit in the field specified.</para>
not fit in the field specified.</para>
</note>
</note>
@ -2426,11 +2425,12 @@ my_func:
<tfoot>
<tfoot>
<row>
<row>
<entry nameend="c4" namest="c1" align="left">
<entry nameend="c4" namest="c1" align="left">
<para><emphasis role="bold">Note:</emphasis>Relocation values 8, 9, 12, 13, 18, 23, 32,
<note>
<para>Relocation values 8, 9, 12, 13, 18, 23, 32,
and 247 are not used. This is to maintain a
and 247 are not used. This is to maintain a
correspondence to the relocation values used by the
correspondence to the relocation values used by the
32-bit PowerPC ELF ABI.
32-bit PowerPC ELF ABI.
</para>
</para></note>
</entry>
</entry>
</row>
</row>
</tfoot>
</tfoot>
@ -3204,7 +3204,7 @@ my_func:
<para>half16ds*</para>
<para>half16ds*</para>
</entry>
</entry>
<entry>
<entry>
<para></para>
<para>(R + A) >> 2</para>
</entry>
</entry>
</row>
</row>
<row>
<row>
@ -4119,9 +4119,7 @@ my_func:
resolved through a call to the symbol’ s procedure linkage table entry.
resolved through a call to the symbol’ s procedure linkage table entry.
Additionally, it instructs the link editor to build a procedure linkage
Additionally, it instructs the link editor to build a procedure linkage
table for the executable or shared object if one is not created.</para>
table for the executable or shared object if one is not created.</para>
<para>
<para><anchor xml:id="dbdoclet.50655241_R_PPC_COPY" xreflabel="" />R_PPC64_COPY</para>
<anchor xml:id="dbdoclet.50655241_R_PPC_COPY"
xreflabel="" /> R_PPC64_COPY</para>
<para>This relocation type is created by the link editor for dynamic
<para>This relocation type is created by the link editor for dynamic
linking. Its offset member refers to a location in a writable segment.
linking. Its offset member refers to a location in a writable segment.
The symbol table index specifies a symbol that should exist both in the
The symbol table index specifies a symbol that should exist both in the
@ -4219,7 +4217,7 @@ ld r3,x@got@l(r3)</programlisting>
<para> </para>
<para> </para>
<note>
<note>
<para>
<para>
<emphasis role="bold">Note:</emphasis> If X is a variable stored in the TOC,
If X is a variable stored in the TOC,
then X@got is the offset within the TOC of a doubleword whose
then X@got is the offset within the TOC of a doubleword whose
value is X@toc.</para>
value is X@toc.</para>
</note>
</note>
@ -4274,7 +4272,7 @@ lwz rt, offset(r2)</programlisting>
<para>Compilers and programmers
<para>Compilers and programmers
<emphasis>must</emphasis> ensure that r2 is live at the actual data access
<emphasis>must</emphasis> ensure that r2 is live at the actual data access
point associated with extended displacement addressing.</para>
point associated with extended displacement addressing.</para>
</section>
<section xml:id="dbdoclet.50655241_19147">
<section xml:id="dbdoclet.50655241_19147">
<title>TOC Pointer Usage</title>
<title>TOC Pointer Usage</title>
<para>To enable linker-based optimizations when global data is accessed,
<para>To enable linker-based optimizations when global data is accessed,
@ -4320,6 +4318,8 @@ target:
rewrite address references created using GOT-indirect loads and bl+4
rewrite address references created using GOT-indirect loads and bl+4
sequences to use TOC-relative address computation.</para>
sequences to use TOC-relative address computation.</para>
</section>
</section>
</section>
<section>
<section>
<title>Fusion</title>
<title>Fusion</title>
<para>Code generation in compilers, linkers, and by programmers should
<para>Code generation in compilers, linkers, and by programmers should
@ -4426,14 +4426,14 @@ addi r4, r4, lower</programlisting>
tlsoffset(m + 1) = round(tlsoffset(m) + tlssize(m), align(m + 1))</programlisting>
tlsoffset(m + 1) = round(tlsoffset(m) + tlssize(m), align(m + 1))</programlisting>
<itemizedlist>
<itemizedlist>
<listitem>
<listitem>
<para>The function round() returns its first argument rounded up to
<para>The function round( ) returns its first argument rounded up to
the next multiple of its second argument:</para>
the next multiple of its second argument:</para>
</listitem>
</listitem>
</itemizedlist>
</itemizedlist>
<programlisting>round(x, y) = y × ceiling(x / y)</programlisting>
<programlisting>round(x, y) = y × ceiling(x / y)</programlisting>
<itemizedlist>
<itemizedlist>
<listitem>
<listitem>
<para>The function ceiling() returns the smallest integer greater
<para>The function ceiling( ) returns the smallest integer greater
than or equal to its argument, where n is an integer satisfying: n -
than or equal to its argument, where n is an integer satisfying: n -
1 < x ≤ n:</para>
1 < x ≤ n:</para>
</listitem>
</listitem>
@ -4441,9 +4441,9 @@ tlsoffset(m + 1) = round(tlsoffset(m) + tlssize(m), align(m + 1))</programlistin
<programlisting>ceiling(x) = n</programlisting>
<programlisting>ceiling(x) = n</programlisting>
<para>In the case of dynamic shared objects (DSO), TLS blocks are
<para>In the case of dynamic shared objects (DSO), TLS blocks are
allocated on an as-needed basis, with the details of allocation
allocated on an as-needed basis, with the details of allocation
abstracted away by the __tls_get_addr() function, which is used to
abstracted away by the __tls_get_addr( ) function, which is used to
retrieve the address of any TLS variable.</para>
retrieve the address of any TLS variable.</para>
<para>The prototype for the __tls_get_addr() function, is defined as
<para>The prototype for the __tls_get_addr( ) function, is defined as
follows.</para>
follows.</para>
<programlisting>typedef struct
<programlisting>typedef struct
{
{
@ -4514,7 +4514,7 @@ extern void *__tls_get_addr (tls_index *ti);</programlisting>
code model, which is the default for the ELF V2 ABI.</para>
code model, which is the default for the ELF V2 ABI.</para>
</note>
</note>
<para>Given the following code fragment, to determine the address of a
<para>Given the following code fragment, to determine the address of a
thread-local variable x, the __tls_get_addr() function is called with one
thread-local variable x, the __tls_get_addr( ) function is called with one
parameter. That parameter is a pointer to a data object of type
parameter. That parameter is a pointer to a data object of type
tls_index.</para>
tls_index.</para>
<programlisting>extern __thread unsigned int x;
<programlisting>extern __thread unsigned int x;
@ -5717,8 +5717,7 @@ static __thread unsigned int x3;
the following code, which makes no reference to GOT entries. The GOT
the following code, which makes no reference to GOT entries. The GOT
entries in
entries in
<xref linkend="dbdoclet.50655241_16273" /> can be removed from the GOT by
<xref linkend="dbdoclet.50655241_16273" /> can be removed from the GOT by
the linker when performing this code transformation.
the linker when performing this code transformation.<footnote xml:id="pgfId-1134055">
<footnote xml:id="pgfId-1134055">
<para>To further optimize the code in
<para>To further optimize the code in
<xref linkend="dbdoclet.50655241_16273" />, a linker may reschedule the
<xref linkend="dbdoclet.50655241_16273" />, a linker may reschedule the
sequence to exploit fusion by generating a sequence that may be fused
sequence to exploit fusion by generating a sequence that may be fused
@ -6251,7 +6250,7 @@ nop</programlisting>
<para>
<para>
<orderedlist>
<orderedlist>
<listitem xml:id="dbdoclet.50655241_21152">
<listitem xml:id="dbdoclet.50655241_21152">
<para>1. The linker may prefer to schedule the addis and
<para>The linker may prefer to schedule the addis and
addi to be adjacent to take advantage of fusion as a
addi to be adjacent to take advantage of fusion as a
microarchitecture optimization opportunity.</para>
microarchitecture optimization opportunity.</para>
</listitem>
</listitem>
@ -6703,7 +6702,7 @@ nop</programlisting>
<para>The result of performing a relocation for a TLS symbol is the
<para>The result of performing a relocation for a TLS symbol is the
module ID and its offset within the TLS block. These are then stored in
module ID and its offset within the TLS block. These are then stored in
the GOT. Later, they are obtained by the dynamic linker at run-time and
the GOT. Later, they are obtained by the dynamic linker at run-time and
passed to __tls_get_addr(), which returns the address for the variable
passed to __tls_get_addr( ), which returns the address for the variable
for the current thread.</para>
for the current thread.</para>
<para>For more information, see
<para>For more information, see
<xref linkend="dbdoclet.50655241_18894" />. For TLS relocations, see
<xref linkend="dbdoclet.50655241_18894" />. For TLS relocations, see