about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/i386/dl-machine.h5
-rw-r--r--sysdeps/sh/dl-machine.h1
-rw-r--r--sysdeps/x86_64/dl-machine.h15
3 files changed, 16 insertions, 5 deletions
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 6f60cf3af0..60122c5324 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -432,6 +432,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
 	     Therefore the offset is already correct.  */
 	  if (sym != NULL)
 	    *reloc_addr = sym->st_value;
+	  CHECK_STATIC_TLS (map, sym_map);
 # endif
 	  break;
 	case R_386_TLS_TPOFF32:
@@ -445,6 +446,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
 	     block we subtract the offset from that of the TLS block.  */
 	  if (sym != NULL)
 	    *reloc_addr += sym_map->l_tls_offset - sym->st_value;
+	  CHECK_STATIC_TLS (map, sym_map);
 # endif
 	  break;
 	case R_386_TLS_TPOFF:
@@ -457,6 +459,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
 	     thread pointer.  */
 	  if (sym != NULL)
 	    *reloc_addr += sym->st_value - sym_map->l_tls_offset;
+	  CHECK_STATIC_TLS (map, sym_map);
 # endif
 	  break;
 #endif	/* use TLS */
@@ -549,6 +552,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 	  *reloc_addr
 	    = (sym == NULL ? 0 : sym_map->l_tls_offset - sym->st_value)
 	      + reloc->r_addend;
+	  CHECK_STATIC_TLS (map, sym_map);
 	  break;
 	case R_386_TLS_TPOFF:
 	  /* The offset is negative, forward from the thread pointer.  */
@@ -558,6 +562,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 	  *reloc_addr
 	    = (sym == NULL ? 0 : sym->st_value - sym_map->l_tls_offset)
 	      + reloc->r_addend;
+	  CHECK_STATIC_TLS (map, sym_map);
 	  break;
 #endif	/* use TLS */
 	default:
diff --git a/sysdeps/sh/dl-machine.h b/sysdeps/sh/dl-machine.h
index 5e264d3cdd..c6d094d26a 100644
--- a/sysdeps/sh/dl-machine.h
+++ b/sysdeps/sh/dl-machine.h
@@ -582,6 +582,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 	  *reloc_addr
 	    = ((sym == NULL ? 0 : sym_map->l_tls_offset + sym->st_value)
 	       + reloc->r_addend);
+	  CHECK_STATIC_TLS (map, sym_map);
 # endif
 	  break;
 #endif	/* use TLS */
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 740d6b7feb..118a4b75b5 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -428,11 +428,16 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 # ifndef RTLD_BOOTSTRAP
 	  if (sym != NULL)
 # endif
-	    /* We know the offset of the object the symbol is contained in.
-	       It is a negative value which will be added to the
-	       thread pointer.  */
-	    *reloc_addr = (sym->st_value + reloc->r_addend
-			   - sym_map->l_tls_offset);
+	    {
+	      /* We know the offset of the object the symbol is contained in.
+		 It is a negative value which will be added to the
+		 thread pointer.  */
+	      *reloc_addr = (sym->st_value + reloc->r_addend
+			     - sym_map->l_tls_offset);
+# ifndef RTLD_BOOTSTRAP
+	      CHECK_STATIC_TLS (map, sym_map);
+# endif
+	    }
 	  break;
 #endif	/* use TLS */