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.h20
-rw-r--r--sysdeps/sh/dl-machine.h10
-rw-r--r--sysdeps/sparc/sparc32/dl-machine.h29
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h26
4 files changed, 48 insertions, 37 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:
diff --git a/sysdeps/sh/dl-machine.h b/sysdeps/sh/dl-machine.h
index a0852a4e71..834b81a4c9 100644
--- a/sysdeps/sh/dl-machine.h
+++ b/sysdeps/sh/dl-machine.h
@@ -580,10 +580,12 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 	     It is a positive value which will be added to the thread
 	     pointer.  To get the variable position in the TLS block
 	     we add 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;
+	    }
 # endif
 	  break;
 #endif	/* use TLS */
diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
index 5f39949c00..52fc6329dd 100644
--- a/sysdeps/sparc/sparc32/dl-machine.h
+++ b/sysdeps/sparc/sparc32/dl-machine.h
@@ -521,22 +521,27 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 	  /* 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;
 # ifndef RTLD_BOOTSTRAP
 	case R_SPARC_TLS_LE_HIX22:
 	case R_SPARC_TLS_LE_LOX10:
-	  CHECK_STATIC_TLS (map, sym_map);
-	  value = (sym == NULL ? 0 : sym->st_value - sym_map->l_tls_offset)
-		  + reloc->r_addend;
-	  if (r_type == R_SPARC_TLS_LE_HIX22)
-	    *reloc_addr = (*reloc_addr & 0xffc00000) | ((~value) >> 10);
-	  else
-	    *reloc_addr = (*reloc_addr & 0xffffe000) | (value & 0x3ff)
-			  | 0x1c00;
+	  if (sym != NULL)
+	    {
+	      CHECK_STATIC_TLS (map, sym_map);
+	      value = sym->st_value - sym_map->l_tls_offset
+		      + reloc->r_addend;
+	      if (r_type == R_SPARC_TLS_LE_HIX22)
+		*reloc_addr = (*reloc_addr & 0xffc00000) | ((~value) >> 10);
+	      else
+		*reloc_addr = (*reloc_addr & 0xffffe000) | (value & 0x3ff)
+			      | 0x1c00;
+	    }
 	  break;
 # endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index 5ba9f3f88b..67cb32645b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2002, 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
 
@@ -70,18 +70,18 @@ handler:
 
 #if RTLD_PRIVATE_ERRNO
 # define SYSCALL_ERROR_HANDLER						\
-	.section .gnu.linkonce.t.__sparc.get_pic.l7,"ax",@progbits;	\
-	.globl __sparc.get_pic.l7;					\
-	.hidden __sparc.get_pic.l7;					\
-	.type __sparc.get_pic.l7,@function;				\
-__sparc.get_pic.l7:							\
+	.section .gnu.linkonce.t.__sparc_get_pic_l7,"ax",@progbits;	\
+	.globl __sparc_get_pic_l7;					\
+	.hidden __sparc_get_pic_l7;					\
+	.type __sparc_get_pic_l7,@function;				\
+__sparc_get_pic_l7:							\
 	retl;								\
 	 add	%o7, %l7, %l7;						\
 	.previous;							\
 SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler)			\
 	save	%sp,-96,%sp;						\
 	sethi	%hi(_GLOBAL_OFFSET_TABLE_-4), %l7;			\
-	call	__sparc.get_pic.l7;					\
+	call	__sparc_get_pic_l7;					\
 	 add	%l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7;			\
 	ld	[%l7 + errno], %l0;					\
 	st	%i0, [%l0];						\
@@ -96,11 +96,11 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler)			\
 # endif
 # ifdef SHARED
 #  define SYSCALL_ERROR_HANDLER						\
-	.section .gnu.linkonce.t.__sparc.get_pic.l7,"ax",@progbits;	\
-	.globl __sparc.get_pic.l7;					\
-	.hidden __sparc.get_pic.l7;					\
-	.type __sparc.get_pic.l7,@function;				\
-__sparc.get_pic.l7:							\
+	.section .gnu.linkonce.t.__sparc_get_pic_l7,"ax",@progbits;	\
+	.globl __sparc_get_pic_l7;					\
+	.hidden __sparc_get_pic_l7;					\
+	.type __sparc_get_pic_l7,@function;				\
+__sparc_get_pic_l7:							\
 	retl;								\
 	 add	%o7, %l7, %l7;						\
 	.previous;							\
@@ -108,7 +108,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler)			\
 	save	%sp,-96,%sp;						\
 	sethi	%tie_hi22(SYSCALL_ERROR_ERRNO), %l1;			\
 	sethi	%hi(_GLOBAL_OFFSET_TABLE_-4), %l7;			\
-	call	__sparc.get_pic.l7;					\
+	call	__sparc_get_pic_l7;					\
 	 add	%l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7;			\
 	add	%l1, %tie_lo10(SYSCALL_ERROR_ERRNO), %l1;		\
 	ld	[%l7 + %l1], %l1, %tie_ld(SYSCALL_ERROR_ERRNO);		\