about summary refs log tree commit diff
path: root/sysdeps/i386/dl-machine.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-11 06:00:19 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-11 06:00:19 +0000
commit2e36cb48e524a8877b56bb61da1a78babb3ef703 (patch)
treeeb2512f6c6ec12bcafd6a2356413a0f0ad3cead0 /sysdeps/i386/dl-machine.h
parent7670e25ad5ac4e72b3fb63ea5e99159d30054d6f (diff)
downloadglibc-2e36cb48e524a8877b56bb61da1a78babb3ef703.tar.gz
glibc-2e36cb48e524a8877b56bb61da1a78babb3ef703.tar.xz
glibc-2e36cb48e524a8877b56bb61da1a78babb3ef703.zip
Update.
	* elf/tst-tls3.c: New file.
	* elf/tst-tlsmod1.c: New file.
	* elf/Makefile: Add rules to build and run tst-tls3.

	* sysdeps/i386/dl-machine.h: Include <tls.h>.
	(elf_machine_type_class): Set ELF_RTYPE_CLASS_PLT also for the three
	TLS relocations.
Diffstat (limited to 'sysdeps/i386/dl-machine.h')
-rw-r--r--sysdeps/i386/dl-machine.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 3e471805d7..9ae18a430a 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -24,6 +24,8 @@
 
 #include <sys/param.h>
 
+#include <tls.h>
+
 /* Return nonzero iff ELF header is compatible with the running host.  */
 static inline int __attribute__ ((unused))
 elf_machine_matches_host (const Elf32_Ehdr *ehdr)
@@ -255,13 +257,22 @@ _dl_start_user:\n\
 # define RTLD_START_SPECIAL_INIT /* nothing */
 #endif
 
-/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
-   PLT entries should not be allowed to define the value.
+/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
+   TLS variable, so undefined references should not be allowed to
+   define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
-#define elf_machine_type_class(type) \
-  ((((type) == R_386_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)	\
+#ifdef USE_TLS
+# define elf_machine_type_class(type) \
+  ((((type) == R_386_JMP_SLOT || (type) == R_386_TLS_DTPMOD32		      \
+     || (type) == R_386_TLS_DTPOFF32 || (type) == R_386_TLS_TPOFF32)	      \
+    * ELF_RTYPE_CLASS_PLT)						      \
    | (((type) == R_386_COPY) * ELF_RTYPE_CLASS_COPY))
+#else
+# define elf_machine_type_class(type) \
+  ((((type) == R_386_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)			      \
+   | (((type) == R_386_COPY) * ELF_RTYPE_CLASS_COPY))
+#endif
 
 /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */
 #define ELF_MACHINE_JMP_SLOT	R_386_JMP_SLOT