This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: TLS improvements for IA32 and AMD64/EM64T


On Sep 16, 2005, "Jan Beulich" <JBeulich@novell.com> wrote:

>> Please check the current x86-64 ABI, the relocations until 31 are all
>> taken and reserved, you cannot use the above ones,

> It's actually 33 meanwhile. And the same proposal that adds 32 and 33
> to x86-64 also suggests using 38 on i386 for a different purpose. See
> the thread starting at
> http://www.x86-64.org/mailing_lists/list?listname=discuss&listnum=0

Thanks, I've renumbered the relocations to avoid conflicts and, while
at that, the dynamic table entries to a more appropriate range.

Here's a patch for the x86-64 ABI document that adds the new
relocations and references the new dynamic table numbers, referring to
the latest version of my specs on the web for details.

I'll post updated patches for binutils and glibc as soon as I get
confirmation that the 3 relocation numbers are at least reserved for
this purpose.

Thanks,

Index: ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* object-files.tex (Relocation Types): Add
	R_X86_64_GOTPC32_TLSDESC, R_X86_64_TLSDESC_CALL and
	R_X86_64_TLSDESC.  Add pointer to description.
	* dl.tex (Procedure Linkage Table): Mention lazy relocation of TLS
	descriptors.

Index: dl.tex
===================================================================
RCS file: /cvs/Repository/x86-64-ABI/dl.tex,v
retrieving revision 1.31
diff -u -p -r1.31 dl.tex
--- dl.tex 24 Aug 2005 15:11:42 -0000 1.31
+++ dl.tex 16 Sep 2005 18:10:44 -0000
@@ -265,6 +265,14 @@ evaluates procedure linkage table entrie
 resolution and relocation until the first execution of a table entry.
 \index{procedure linkage table|)}
 
+Relocation entries of type \codeindex{R_X86_64_TLSDESC} may also be
+subject to lazy relocation, using a single entry in the procedure
+linkage table and in the global offset table, at locations given by
+\texttt{DT_TLSDESC_PLT} and \texttt{DT_TLSDESC_GOT}, respectively, as
+described in ``Thread-Local Storage Descriptors for IA32 and
+AMD64/EM64T''\footnote{This document is currently available via
+  \url{http://people.redhat.com/aoliva/writeups/TLS/RFC-TLSDESC-x86.txt}}.
+
 \subsubsection{Large Models}
 
 In the small and medium code models the size of both the PLT and the GOT
Index: object-files.tex
===================================================================
RCS file: /cvs/Repository/x86-64-ABI/object-files.tex,v
retrieving revision 1.36
diff -u -p -r1.36 object-files.tex
--- object-files.tex 14 Sep 2005 22:36:07 -0000 1.36
+++ object-files.tex 16 Sep 2005 18:10:46 -0000
@@ -448,6 +448,9 @@ the relocation addend.
       \texttt{R_X86_64_GOTPC32} & 26 & \textit{word32} & \texttt{GOT + A - P} \\
       \texttt{R_X86_64_SIZE32} & 32 & \textit{word32} & \texttt{Z + A} \\
       \texttt{R_X86_64_SIZE64} & 33 & \textit{word64} & \texttt{Z + A} \\
+      \texttt{R_X86_64_GOTPC32_TLSDESC} & 34 & \textit{word32} &  \\
+      \texttt{R_X86_64_TLSDESC_CALL} & 35 & none &  \\
+      \texttt{R_X86_64_TLSDESC} & 36 & \textit{word64}$\times 2$ & \\
 %      \texttt{R_X86_64_GOT64} & 16 & \textit{word64} & \texttt{G + A} \\
 %      \texttt{R_X86_64_PLT64} & 17 & \textit{word64} & \texttt{L + A - P} \\
     \end{tabular}
@@ -501,7 +504,14 @@ The relocations \texttt{R_X86_64_DPTMOD6
 of the Thread-Local Storage ABI extensions and are documented in the
 document called ``ELF Handling for Thread-Local
 Storage''\footnote{This document is currently available via
-  \url{http://people.redhat.com/drepper/tls.pdf}}\index{Thread-Local Storage}.
+  \url{http://people.redhat.com/drepper/tls.pdf}}\index{Thread-Local
+  Storage}.  The relocations \texttt{R_X86_64_GOTPC32_TLSDESC},
+\texttt{R_X86_64_TLSDESC_CALL} and \texttt{R_X86_64_TLSDESC} are also
+used for Thread-Local Storage, but are not documented there as of this
+writing.  A description can be found in the document ``Thread-Local
+Storage Descriptors for IA32 and AMD64/EM64T''\footnote{This document
+  is currently available via
+  \url{http://people.redhat.com/aoliva/writeups/TLS/RFC-TLSDESC-x86.txt}}.
 
 \end{sloppypar}
 
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]