tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

TLS relocs



Hi,

Unless anyone objects I'll commit this soon.

The list of relocations is taken from various sources, including

        http://people.redhat.com/drepper/tls.pdf
        http://wiki.parisc-linux.org/ThreadLocalStorage

I can't find a specification document for powerpc / m68k so I've just use 
binutils sources as a reference.

Thanks,
Nick
Index: sys/arch/alpha/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/include/elf_machdep.h,v
retrieving revision 1.10
diff -u -p -u -r1.10 elf_machdep.h
--- sys/arch/alpha/include/elf_machdep.h        9 Dec 2001 23:05:56 -0000       
1.10
+++ sys/arch/alpha/include/elf_machdep.h        19 May 2009 05:52:26 -0000
@@ -58,6 +58,21 @@ typedef      uint64_t        Elf64_Word;
 #define        R_ALPHA_JMP_SLOT        26      /* Create PLT entry */
 #define        R_ALPHA_RELATIVE        27      /* Adjust by program base */
 
+/* TLS relocations */
+#define        R_ALPHA_TLS_GD          29
+#define        R_ALPHA_TLSLDM          30
+#define        R_ALPHA_DTPMOD64        31
+#define        R_ALPHA_GOTDTPREL       32
+#define        R_ALPHA_DTPREL64        33
+#define        R_ALPHA_DTPRELHI        34
+#define        R_ALPHA_DTPRELLO        35
+#define        R_ALPHA_DTPREL16        36
+#define        R_ALPHA_GOTTPREL        37
+#define        R_ALPHA_TPREL64         38
+#define        R_ALPHA_TPRELHI         39
+#define        R_ALPHA_TPRELLO         40
+#define        R_ALPHA_TPREL16         41
+
 #define        R_TYPE(name)            __CONCAT(R_ALPHA_,name)
 
 #endif /* _ALPHA_ELF_MACHDEP_H_ */
Index: sys/arch/amd64/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/include/elf_machdep.h,v
retrieving revision 1.2
diff -u -p -u -r1.2 elf_machdep.h
--- sys/arch/amd64/include/elf_machdep.h        26 Oct 2008 00:08:15 -0000      
1.2
+++ sys/arch/amd64/include/elf_machdep.h        19 May 2009 05:52:26 -0000
@@ -36,6 +36,16 @@
 #define R_X86_64_8             14
 #define R_X86_64_PC8           15
 
+/* TLS relocations */
+#define R_X86_64_DTPMOD64      16
+#define R_X86_64_DTPOFF64      17
+#define R_X86_64_TPOFF64       18
+#define R_X86_64_TLSGD         19
+#define R_X86_64_TLSLD         20
+#define R_X86_64_DTPOFF32      21
+#define R_X86_64_GOTTPOFF      22
+#define R_X86_64_TPOFF32       23
+
 #define        R_TYPE(name)    __CONCAT(R_X86_64_,name)
 
 #else  /*      __x86_64__      */
Index: sys/arch/arm/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/include/elf_machdep.h,v
retrieving revision 1.7
diff -u -p -u -r1.7 elf_machdep.h
--- sys/arch/arm/include/elf_machdep.h  8 Sep 2006 19:09:19 -0000       1.7
+++ sys/arch/arm/include/elf_machdep.h  19 May 2009 05:52:26 -0000
@@ -54,6 +54,11 @@
 #define R_ARM_XPC25            15
 #define R_ARM_THM_XPC22                16
 
+/* TLS relocations */
+#define R_ARM_TLS_DTPMOD32     17      /* ID of module containing symbol */
+#define R_ARM_TLS_DTPOFF32     18      /* Offset in TLS block */
+#define R_ARM_TLS_TPOFF32      19      /* Offset in static TLS block */
+
 /* 17-31 are reserved for ARM Linux. */
 #define R_ARM_COPY             20
 #define R_ARM_GLOB_DAT         21
@@ -77,6 +82,16 @@
 #define R_ARM_THM_PC11         102
 #define R_ARM_THM_PC9          103
 
+/* More TLS relocations */
+#define R_ARM_TLS_GD32         104     /* PC-rel 32 bit for global dynamic */
+#define R_ARM_TLS_LDM32                105     /* PC-rel 32 bit for local 
dynamic */
+#define R_ARM_TLS_LDO32                106     /* 32 bit offset relative to 
TLS */
+#define R_ARM_TLS_IE32         107     /* PC-rel 32 bit for GOT entry of */
+#define R_ARM_TLS_LE32         108
+#define R_ARM_TLS_LDO12                109
+#define R_ARM_TLS_LE12         110
+#define R_ARM_TLS_IE12GP       111
+
 /* 112-127 are reserved for private experiments. */
 
 #define R_ARM_RXPC25           249
Index: sys/arch/hppa/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/hppa/include/elf_machdep.h,v
retrieving revision 1.2
diff -u -p -u -r1.2 elf_machdep.h
--- sys/arch/hppa/include/elf_machdep.h 19 May 2009 05:50:58 -0000      1.2
+++ sys/arch/hppa/include/elf_machdep.h 19 May 2009 05:52:27 -0000
@@ -126,4 +126,25 @@
 #define R_PARISC_GNU_VTENTRY    232
 #define R_PARISC_GNU_VTINHERIT  233
 
+/* TLS relocations */
+#define R_PARISC_TLS_GD21L     234
+#define R_PARISC_TLS_GD14R     235
+#define R_PARISC_TLS_GDCALL    236
+#define R_PARISC_TLS_LDM21L    237
+#define R_PARISC_TLS_LDM14R    238
+#define R_PARISC_TLS_LDMCALL   239
+#define R_PARISC_TLS_LDO21L    240
+#define R_PARISC_TLS_LDO14R    241
+#define R_PARISC_TLS_DTPMOD32  242
+#define R_PARISC_TLS_DTPMOD64  243
+#define R_PARISC_TLS_DTPOFF32  244
+#define R_PARISC_TLS_DTPOFF64  245
+
+#define R_PARISC_TLS_LE21L     R_PARISC_TPREL21L
+#define R_PARISC_TLS_LE14R     R_PARISC_TPREL14R
+#define R_PARISC_TLS_IE21L     R_PARISC_LTOFF_TP21L
+#define R_PARISC_TLS_IE14R     R_PARISC_LTOFF_TP14R
+#define R_PARISC_TLS_TPREL32   R_PARISC_TPREL32
+#define R_PARISC_TLS_TPREL64   R_PARISC_TPREL64
+
 #define        R_TYPE(name)    __CONCAT(R_PARISC_,name)
Index: sys/arch/i386/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/include/elf_machdep.h,v
retrieving revision 1.9
diff -u -p -u -r1.9 elf_machdep.h
--- sys/arch/i386/include/elf_machdep.h 9 Dec 2001 23:05:57 -0000       1.9
+++ sys/arch/i386/include/elf_machdep.h 19 May 2009 05:52:27 -0000
@@ -26,10 +26,38 @@
 #define        R_386_RELATIVE  8
 #define        R_386_GOTOFF    9
 #define        R_386_GOTPC     10
+
+/* TLS relocations */
+#define        R_386_TLS_TPOFF 14
+#define        R_386_TLS_IE    15
+#define        R_386_TLS_GOTIE 16
+#define        R_386_TLS_LE    17
+#define        R_386_TLS_GD    18
+#define        R_386_TLS_LDM   19
+
 /* The following relocations are GNU extensions. */
 #define        R_386_16        20
 #define        R_386_PC16      21
 #define        R_386_8         22
 #define        R_386_PC8       23
 
+/* More TLS relocations */
+#define        R_386_TLS_GD_32         24
+#define        R_386_TLS_GD_PUSH       25
+#define        R_386_TLS_GD_CALL       26
+#define        R_386_TLS_GD_POP        27
+#define        R_386_TLS_LDM_32        28
+#define        R_386_TLS_LDM_PUSH      29
+#define        R_386_TLS_LDM_CALL      30
+#define        R_386_TLS_LDM_POP       31
+#define        R_386_TLS_LDO_32        32
+#define        R_386_TLS_IE_32         33
+#define        R_386_TLS_LE_32         34
+#define        R_386_TLS_DTPMOD32      35
+#define        R_386_TLS_DTPOFF32      36
+#define        R_386_TLS_TPOFF32       37
+#define        R_386_TLS_GOTDESC       39
+#define        R_386_TLS_DESC_CALL     40
+#define        R_386_TLS_DESC          41
+
 #define        R_TYPE(name)    __CONCAT(R_386_,name)
Index: sys/arch/m68k/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/m68k/include/elf_machdep.h,v
retrieving revision 1.7
diff -u -p -u -r1.7 elf_machdep.h
--- sys/arch/m68k/include/elf_machdep.h 28 Jan 2002 21:34:48 -0000      1.7
+++ sys/arch/m68k/include/elf_machdep.h 19 May 2009 05:52:27 -0000
@@ -44,4 +44,24 @@
 #define        R_68K_JMP_SLOT  21
 #define        R_68K_RELATIVE  22
 
+/* TLS relocations */
+#define R_68K_TLS_GD32         25
+#define R_68K_TLS_GD16         26
+#define R_68K_TLS_GD8          27
+#define R_68K_TLS_LDM32                28
+#define R_68K_TLS_LDM16                29
+#define R_68K_TLS_LDM8         30
+#define R_68K_TLS_LDO32                31
+#define R_68K_TLS_LDO16                32
+#define R_68K_TLS_LDO8         33
+#define R_68K_TLS_IE32         34
+#define R_68K_TLS_IE16         35
+#define R_68K_TLS_IE8          36
+#define R_68K_TLS_LE32         37
+#define R_68K_TLS_LE16         38
+#define R_68K_TLS_LE8          39
+#define R_68K_TLS_DTPMOD32     40
+#define R_68K_TLS_DTPREL32     41
+#define R_68K_TLS_TPREL32      42
+
 #define        R_TYPE(name)    __CONCAT(R_68K_,name)
Index: sys/arch/mips/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/include/elf_machdep.h,v
retrieving revision 1.10
diff -u -p -u -r1.10 elf_machdep.h
--- sys/arch/mips/include/elf_machdep.h 11 Dec 2005 12:18:09 -0000      1.10
+++ sys/arch/mips/include/elf_machdep.h 19 May 2009 05:52:27 -0000
@@ -63,9 +63,23 @@
 #define R_MIPS_PJUMP           35
 #define R_MIPS_RELGOT          36
 
-#define R_MIPS_max             37
-#define R_TYPE(name)           __CONCAT(R_MIPS_,name)
+#define R_MIPS_TLS_DTPMOD32    38      /* Module number 32 bit */
+#define R_MIPS_TLS_DTPREL32    39      /* Module-relative offset 32 bit */
+#define R_MIPS_TLS_DTPMOD64    40      /* Module number 64 bit */
+#define R_MIPS_TLS_DTPREL64    41      /* Module-relative offset 64 bit */
+#define R_MIPS_TLS_GD          42      /* 16 bit GOT offset for GD */
+#define R_MIPS_TLS_LDM         43      /* 16 bit GOT offset for LDM */
+#define R_MIPS_TLS_DTPREL_HI16 44      /* Module-relative offset, high 16 bits 
*/
+#define R_MIPS_TLS_DTPREL_LO16 45      /* Module-relative offset, low 16 bits 
*/
+#define R_MIPS_TLS_GOTTPREL    46      /* 16 bit GOT offset for IE */
+#define R_MIPS_TLS_TPREL32     47      /* TP-relative offset, 32 bit */
+#define R_MIPS_TLS_TPREL64     48      /* TP-relative offset, 64 bit */
+#define R_MIPS_TLS_TPREL_HI16  49      /* TP-relative offset, high 16 bits */
+#define R_MIPS_TLS_TPREL_LO16  50      /* TP-relative offset, low 16 bits */
+
+#define R_MIPS_max             51
 
+#define R_TYPE(name)           __CONCAT(R_MIPS_,name)
 
 /* mips dynamic tags */
 
Index: sys/arch/powerpc/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/include/elf_machdep.h,v
retrieving revision 1.7
diff -u -p -u -r1.7 elf_machdep.h
--- sys/arch/powerpc/include/elf_machdep.h      25 Nov 2006 18:04:33 -0000      
1.7
+++ sys/arch/powerpc/include/elf_machdep.h      19 May 2009 05:52:27 -0000
@@ -53,4 +53,39 @@
 #define        R_PPC_PLT16_HA          31
 #define        R_PPC_SDAREL            32
 
+/* TLS relocations */
+#define        R_PPC_TLS               67
+
+#define        R_PPC_DTPMOD32          68
+#define        R_PPC_TPREL16           69
+#define        R_PPC_TPREL16_LO        70
+#define        R_PPC_TPREL16_HI        71
+#define        R_PPC_TPREL16_HA        72
+#define        R_PPC_TPREL32           73
+#define        R_PPC_DTPREL16          74
+#define        R_PPC_DTPREL16_LO       75
+#define        R_PPC_DTPREL16_HI       76
+#define        R_PPC_DTPREL16_HA       77
+#define        R_PPC_DTPREL32          78
+
+#define        R_PPC_GOT_TLSGD16       79
+#define        R_PPC_GOT_TLSGD16_LO    80
+#define        R_PPC_GOT_TLSGD16_HI    81
+#define        R_PPC_GOT_TLSGD16_HA    82
+#define        R_PPC_GOT_TLSLD16       83
+#define        R_PPC_GOT_TLSLD16_LO    84
+#define        R_PPC_GOT_TLSLD16_HI    85
+#define        R_PPC_GOT_TLSLD16_HA    86
+
+#define        R_PPC_GOT_TPREL16       87
+#define        R_PPC_GOT_TPREL16_LO    88
+#define        R_PPC_GOT_TPREL16_HI    89
+#define        R_PPC_GOT_TPREL16_HA    90
+#define        R_PPC_GOT_DTPREL16      91
+#define        R_PPC_GOT_DTPREL16_LO   92
+#define        R_PPC_GOT_DTPREL16_HI   93
+#define        R_PPC_GOT_DTPREL16_HA   94
+#define        R_PPC_TLSGD             95
+#define        R_PPC_TLSLD             96
+
 #define R_TYPE(name)           __CONCAT(R_PPC_,name)
Index: sys/arch/sh3/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sh3/include/elf_machdep.h,v
retrieving revision 1.9
diff -u -p -u -r1.9 elf_machdep.h
--- sys/arch/sh3/include/elf_machdep.h  25 Nov 2006 07:32:53 -0000      1.9
+++ sys/arch/sh3/include/elf_machdep.h  19 May 2009 05:52:27 -0000
@@ -62,6 +62,17 @@
 #define        R_SH_GNU_VTENTRY        35
 #define        R_SH_LOOP_START         36
 #define        R_SH_LOOP_END           37
+
+/* TLS relocations */
+#define        R_SH_TLS_GD_32          144
+#define        R_SH_TLS_LD_32          145
+#define        R_SH_TLS_LDO_32         146
+#define        R_SH_TLS_IE_32          147
+#define        R_SH_TLS_LE_32          148
+#define        R_SH_TLS_DTPMOD32       149
+#define        R_SH_TLS_DTPOFF32       150
+#define        R_SH_TLS_TPOFF32        151
+
 #define        R_SH_GOT32              160
 #define        R_SH_PLT32              161
 #define        R_SH_COPY               162
Index: sys/arch/sparc/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/include/elf_machdep.h,v
retrieving revision 1.6
diff -u -p -u -r1.6 elf_machdep.h
--- sys/arch/sparc/include/elf_machdep.h        9 Dec 2001 23:05:58 -0000       
1.6
+++ sys/arch/sparc/include/elf_machdep.h        19 May 2009 05:52:27 -0000
@@ -63,4 +63,30 @@
 #define R_SPARC_5              44
 #define R_SPARC_6              45
 
+/* TLS relocations */
+#define R_SPARC_TLS_GD_HI22    56
+#define R_SPARC_TLS_GD_LO10    57
+#define R_SPARC_TLS_GD_ADD     58
+#define R_SPARC_TLS_GD_CALL    59
+#define R_SPARC_TLS_LDM_HI22   60
+#define R_SPARC_TLS_LDM_LO10   61
+#define R_SPARC_TLS_LDM_ADD    62
+#define R_SPARC_TLS_LDM_CALL   63
+#define R_SPARC_TLS_LDO_HIX22  64
+#define R_SPARC_TLS_LDO_LOX10  65
+#define R_SPARC_TLS_LDO_ADD    66
+#define R_SPARC_TLS_IE_HI22    67
+#define R_SPARC_TLS_IE_LO10    68
+#define R_SPARC_TLS_IE_LD      69
+#define R_SPARC_TLS_IE_LDX     70
+#define R_SPARC_TLS_IE_ADD     71
+#define R_SPARC_TLS_LE_HIX22   72
+#define R_SPARC_TLS_LE_LOX10   73
+#define R_SPARC_TLS_DTPMOD32   74
+#define R_SPARC_TLS_DTPMOD64   75
+#define R_SPARC_TLS_DTPOFF32   76
+#define R_SPARC_TLS_DTPOFF64   77
+#define R_SPARC_TLS_TPOFF32    78
+#define R_SPARC_TLS_TPOFF64    79
+
 #define R_TYPE(name)           __CONCAT(R_SPARC_,name)
Index: sys/arch/sparc64/include/elf_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/include/elf_machdep.h,v
retrieving revision 1.9
diff -u -p -u -r1.9 elf_machdep.h
--- sys/arch/sparc64/include/elf_machdep.h      14 Mar 2006 21:37:48 -0000      
1.9
+++ sys/arch/sparc64/include/elf_machdep.h      19 May 2009 05:52:27 -0000
@@ -101,5 +101,30 @@
 #define        R_SPARC_UA64            54
 #define        R_SPARC_UA16            55
 
+/* TLS relocations */
+#define R_SPARC_TLS_GD_HI22    56
+#define R_SPARC_TLS_GD_LO10    57
+#define R_SPARC_TLS_GD_ADD     58
+#define R_SPARC_TLS_GD_CALL    59
+#define R_SPARC_TLS_LDM_HI22   60
+#define R_SPARC_TLS_LDM_LO10   61
+#define R_SPARC_TLS_LDM_ADD    62
+#define R_SPARC_TLS_LDM_CALL   63
+#define R_SPARC_TLS_LDO_HIX22  64
+#define R_SPARC_TLS_LDO_LOX10  65
+#define R_SPARC_TLS_LDO_ADD    66
+#define R_SPARC_TLS_IE_HI22    67
+#define R_SPARC_TLS_IE_LO10    68
+#define R_SPARC_TLS_IE_LD      69
+#define R_SPARC_TLS_IE_LDX     70
+#define R_SPARC_TLS_IE_ADD     71
+#define R_SPARC_TLS_LE_HIX22   72
+#define R_SPARC_TLS_LE_LOX10   73
+#define R_SPARC_TLS_DTPMOD32   74
+#define R_SPARC_TLS_DTPMOD64   75
+#define R_SPARC_TLS_DTPOFF32   76
+#define R_SPARC_TLS_DTPOFF64   77
+#define R_SPARC_TLS_TPOFF32    78
+#define R_SPARC_TLS_TPOFF64    79
 
 #define R_TYPE(name)           __CONCAT(R_SPARC_,name)


Home | Main Index | Thread Index | Old Index