about summary refs log tree commit diff
path: root/sysdeps/i386/dl-machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/dl-machine.h')
-rw-r--r--sysdeps/i386/dl-machine.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 26abbfb64a..65ae53a408 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -587,20 +587,24 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 	     It is a positive value which will be subtracted from the
 	     thread pointer.  To get the variable position in the TLS
 	     block we subtract the offset from that of the TLS block.  */
-	  CHECK_STATIC_TLS (map, sym_map);
-	  *reloc_addr
-	    = (sym == NULL ? 0 : sym_map->l_tls_offset - sym->st_value)
-	      + reloc->r_addend;
+	  if (sym != NULL)
+	    {
+	      CHECK_STATIC_TLS (map, sym_map);
+	      *reloc_addr = sym_map->l_tls_offset - sym->st_value
+			    + reloc->r_addend;
+	    }
 	  break;
 	case R_386_TLS_TPOFF:
 	  /* The offset is negative, forward from the thread pointer.  */
 	  /* We know the offset of object the symbol is contained in.
 	     It is a negative value which will be added to the
 	     thread pointer.  */
-	  CHECK_STATIC_TLS (map, sym_map);
-	  *reloc_addr
-	    = (sym == NULL ? 0 : sym->st_value - sym_map->l_tls_offset)
-	      + reloc->r_addend;
+	  if (sym != NULL)
+	    {
+	      CHECK_STATIC_TLS (map, sym_map);
+	      *reloc_addr = sym->st_value - sym_map->l_tls_offset
+			    + reloc->r_addend;
+	    }
 	  break;
 #  endif	/* use TLS */
 	case R_386_COPY: