about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--elf/dl-reloc.c24
-rw-r--r--elf/do-rel.h4
-rw-r--r--elf/dynamic-link.h31
-rw-r--r--linuxthreads/ChangeLog18
-rw-r--r--linuxthreads/sysdeps/alpha/tls.h10
-rw-r--r--linuxthreads/sysdeps/ia64/pt-machine.h10
-rw-r--r--linuxthreads/sysdeps/s390/s390-32/pt-machine.h10
-rw-r--r--linuxthreads/sysdeps/s390/s390-64/pt-machine.h10
-rw-r--r--linuxthreads/sysdeps/sh/pt-machine.h12
-rw-r--r--linuxthreads/sysdeps/sparc/sparc32/pt-machine.h10
-rw-r--r--linuxthreads/sysdeps/sparc/sparc64/pt-machine.h10
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/clone.S4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/clone.S4
13 files changed, 107 insertions, 50 deletions
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 7d28553eba..0443011b36 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -39,9 +39,9 @@
 /* We are trying to perform a static TLS relocation in MAP, but it was
    dynamically loaded.  This can only work if there is enough surplus in
    the static TLS area already allocated for each running thread.  If this
-   object's TLS segment is too big to fit, we return false.  If it fits,
-   we set MAP->l_tls_offset and return true.  */
-static bool
+   object's TLS segment is too big to fit, we fail.  If it fits,
+   we set MAP->l_tls_offset and return.  */
+static void __attribute_noinline__
 allocate_static_tls (struct link_map *map)
 {
   size_t offset = roundup (GL(dl_tls_static_used), map->l_tls_align);
@@ -54,10 +54,13 @@ allocate_static_tls (struct link_map *map)
 #  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
 # endif
       > GL(dl_tls_static_size))
-    return false;
+    {
+      const char *errstring = N_("\
+shared object cannot be dlopen()ed: static TLS memory too small");
+      INTUSE(_dl_signal_error) (0, (map)->l_name, NULL, errstring);
+    }
   map->l_tls_offset = offset;
   GL(dl_tls_static_used) = offset + map->l_tls_blocksize;
-  return true;
 }
 #endif
 
@@ -197,13 +200,8 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
        intended to produce.  */
 #define CHECK_STATIC_TLS(map, sym_map)					      \
     do {								      \
-      if (__builtin_expect ((sym_map)->l_tls_offset == 0, 0)		      \
-	  && !allocate_static_tls (sym_map))				      \
-	{								      \
-	  errstring = N_("\
-shared object cannot be dlopen()ed: static TLS memory too small");	      \
-	  INTUSE(_dl_signal_error) (0, (map)->l_name, NULL, errstring);	      \
-	}								      \
+      if (__builtin_expect ((sym_map)->l_tls_offset == 0, 0))		      \
+	allocate_static_tls (sym_map);					      \
     } while (0)
 
 #include "dynamic-link.h"
@@ -256,7 +254,7 @@ INTDEF (_dl_relocate_object)
 
 
 void
-internal_function
+internal_function __attribute_noinline__
 _dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt)
 {
   extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;
diff --git a/elf/do-rel.h b/elf/do-rel.h
index 9ebffd8570..726418748c 100644
--- a/elf/do-rel.h
+++ b/elf/do-rel.h
@@ -1,5 +1,5 @@
 /* Do relocations for ELF dynamic linking.
-   Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -49,7 +49,7 @@
    relocations; they should be set up to call _dl_runtime_resolve, rather
    than fully resolved now.  */
 
-static inline void
+static inline void __attribute__ ((always_inline))
 elf_dynamic_do_rel (struct link_map *map,
 		    ElfW(Addr) reladdr, ElfW(Addr) relsize,
 		    int lazy)
diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
index 6a8871ea9c..63adfcb802 100644
--- a/elf/dynamic-link.h
+++ b/elf/dynamic-link.h
@@ -1,5 +1,5 @@
 /* Inline functions for dynamic linking.
-   Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,9 +18,36 @@
    02111-1307 USA.  */
 
 #include <elf.h>
-#include <dl-machine.h>
 #include <assert.h>
 
+#ifdef RESOLVE
+auto void __attribute__((always_inline))
+elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
+		 const ElfW(Sym) *sym, const struct r_found_version *version,
+		 ElfW(Addr) *const reloc_addr);
+auto void __attribute__((always_inline))
+elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
+		  const ElfW(Sym) *sym, const struct r_found_version *version,
+		  ElfW(Addr) *const reloc_addr);
+auto void __attribute__((always_inline))
+elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
+			  ElfW(Addr) *const reloc_addr);
+auto void __attribute__((always_inline))
+elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
+			   ElfW(Addr) *const reloc_addr);
+# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
+auto void __attribute__((always_inline))
+elf_machine_lazy_rel (struct link_map *map,
+		      ElfW(Addr) l_addr, const ElfW(Rel) *reloc);
+# else
+auto void __attribute__((always_inline))
+elf_machine_lazy_rel (struct link_map *map,
+		      ElfW(Addr) l_addr, const ElfW(Rela) *reloc);
+# endif
+#endif
+
+#include <dl-machine.h>
+
 #ifndef VERSYMIDX
 # define VERSYMIDX(sym)	(DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym))
 #endif
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 80de0debab..52da3264ae 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,21 @@
+2003-01-30  Jakub Jelinek  <jakub@redhat.com>
+
+	* sysdeps/alpha/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC,
+	THREAD_SETMEM, THREAD_SETMEM_NC): Avoid warnings about unused self
+	variable.
+	* sysdeps/ia64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
+	THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
+	* sysdeps/s390/s390-32/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
+	THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
+	* sysdeps/s390/s390-64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
+	THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
+	* sysdeps/sh/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
+	THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
+	* sysdeps/sparc/sparc32/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
+	THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
+	* sysdeps/sparc/sparc64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
+	THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
+
 2003-01-27  Martin Schwidefsky  <schwidefsky@de.ibm.com>
 
 	* sysdeps/s390/s390-32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
diff --git a/linuxthreads/sysdeps/alpha/tls.h b/linuxthreads/sysdeps/alpha/tls.h
index d93c91fc52..261e67dd0f 100644
--- a/linuxthreads/sysdeps/alpha/tls.h
+++ b/linuxthreads/sysdeps/alpha/tls.h
@@ -114,10 +114,12 @@ typedef struct
    the compiler does its job and unifies the multiple
    __builtin_thread_pointer instances.  */
 
-#define THREAD_GETMEM(descr, member) THREAD_SELF->member
-#define THREAD_GETMEM_NC(descr, member) THREAD_SELF->member
-#define THREAD_SETMEM(descr, member, value) (THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) (THREAD_SELF->member = (value))
+#define THREAD_GETMEM(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
 
 # endif	/* HAVE_TLS_SUPPORT */
 #endif /* __ASSEMBLER__ */
diff --git a/linuxthreads/sysdeps/ia64/pt-machine.h b/linuxthreads/sysdeps/ia64/pt-machine.h
index 4b88a00509..6efe66966d 100644
--- a/linuxthreads/sysdeps/ia64/pt-machine.h
+++ b/linuxthreads/sysdeps/ia64/pt-machine.h
@@ -64,10 +64,12 @@ register struct _pthread_descr_struct *__thread_self __asm__("r13");
 
 
 /* Access to data in the thread descriptor is easy.  */
-#define THREAD_GETMEM(descr, member) THREAD_SELF->member
-#define THREAD_GETMEM_NC(descr, member) THREAD_SELF->member
-#define THREAD_SETMEM(descr, member, value) THREAD_SELF->member = (value)
-#define THREAD_SETMEM_NC(descr, member, value) THREAD_SELF->member = (value)
+#define THREAD_GETMEM(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
 
 
 /* Memory barrier */
diff --git a/linuxthreads/sysdeps/s390/s390-32/pt-machine.h b/linuxthreads/sysdeps/s390/s390-32/pt-machine.h
index ee35320059..c3a8110084 100644
--- a/linuxthreads/sysdeps/s390/s390-32/pt-machine.h
+++ b/linuxthreads/sysdeps/s390/s390-32/pt-machine.h
@@ -80,10 +80,12 @@ register char * stack_pointer __asm__ ("15");
 #endif
 
 /* Access to data in the thread descriptor is easy.  */
-#define THREAD_GETMEM(descr, member) THREAD_SELF->member
-#define THREAD_GETMEM_NC(descr, member) THREAD_SELF->member
-#define THREAD_SETMEM(descr, member, value) THREAD_SELF->member = (value)
-#define THREAD_SETMEM_NC(descr, member, value) THREAD_SELF->member = (value)
+#define THREAD_GETMEM(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
 
 /* We want the OS to assign stack addresses.  */
 #define FLOATING_STACKS 1
diff --git a/linuxthreads/sysdeps/s390/s390-64/pt-machine.h b/linuxthreads/sysdeps/s390/s390-64/pt-machine.h
index c0f30789c2..5cab958cfa 100644
--- a/linuxthreads/sysdeps/s390/s390-64/pt-machine.h
+++ b/linuxthreads/sysdeps/s390/s390-64/pt-machine.h
@@ -86,10 +86,12 @@ register char * stack_pointer __asm__ ("15");
 #endif
 
 /* Access to data in the thread descriptor is easy.  */
-#define THREAD_GETMEM(descr, member) THREAD_SELF->member
-#define THREAD_GETMEM_NC(descr, member) THREAD_SELF->member
-#define THREAD_SETMEM(descr, member, value) THREAD_SELF->member = (value)
-#define THREAD_SETMEM_NC(descr, member, value) THREAD_SELF->member = (value)
+#define THREAD_GETMEM(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
 
 /* We want the OS to assign stack addresses.  */
 #define FLOATING_STACKS 1
diff --git a/linuxthreads/sysdeps/sh/pt-machine.h b/linuxthreads/sysdeps/sh/pt-machine.h
index cc3a4f2ce9..c7fcc694b1 100644
--- a/linuxthreads/sysdeps/sh/pt-machine.h
+++ b/linuxthreads/sysdeps/sh/pt-machine.h
@@ -1,6 +1,6 @@
 /* Machine-dependent pthreads configuration and inline functions.
    SuperH version.
-   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Niibe Yutaka <gniibe@m17n.org>.
 
@@ -68,10 +68,12 @@ struct _pthread_descr_struct;
   ({ __asm__ __volatile__("ldc %0,gbr" : : "r" (descr));})
 
 /* Access to data in the thread descriptor is easy.  */
-#define THREAD_GETMEM(descr, member) THREAD_SELF->member
-#define THREAD_GETMEM_NC(descr, member) THREAD_SELF->member
-#define THREAD_SETMEM(descr, member, value) THREAD_SELF->member = (value)
-#define THREAD_SETMEM_NC(descr, member, value) THREAD_SELF->member = (value)
+#define THREAD_GETMEM(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
 #endif /* __ASSEMBLER__ */
 
 #endif /* pt-machine.h */
diff --git a/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h b/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
index cbfc872df2..404edf2b95 100644
--- a/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
+++ b/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
@@ -65,10 +65,12 @@ register struct _pthread_descr_struct *__thread_self __asm__("%g7");
 #define INIT_THREAD_SELF(descr, nr)  (__thread_self = (descr))
 
 /* Access to data in the thread descriptor is easy.  */
-#define THREAD_GETMEM(descr, member) __thread_self->member
-#define THREAD_GETMEM_NC(descr, member) __thread_self->member
-#define THREAD_SETMEM(descr, member, value) __thread_self->member = (value)
-#define THREAD_SETMEM_NC(descr, member, value) __thread_self->member = (value)
+#define THREAD_GETMEM(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
 
 /* We want the OS to assign stack addresses.  */
 #define FLOATING_STACKS 1
diff --git a/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h b/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
index 3087020e1b..291a73291c 100644
--- a/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
+++ b/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
@@ -87,10 +87,12 @@ __compare_and_swap (long int *p, long int oldval, long int newval)
 }
 
 /* Access to data in the thread descriptor is easy.  */
-#define THREAD_GETMEM(descr, member) __thread_self->member
-#define THREAD_GETMEM_NC(descr, member) __thread_self->member
-#define THREAD_SETMEM(descr, member, value) __thread_self->member = (value)
-#define THREAD_SETMEM_NC(descr, member, value) __thread_self->member = (value)
+#define THREAD_GETMEM(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) (sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+  (sizeof (descr), THREAD_SELF->member = (value))
 
 /* We want the OS to assign stack addresses.  */
 #define FLOATING_STACKS 1
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
index 91c362a2e8..650384cbc9 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
@@ -42,10 +42,10 @@ ENTRY(__clone)
 	l	%r5,100(%r15)		/* load child_tid from stack */
 	l	%r6,96(%r15)		/* load tls from stack */
 	svc	SYS_ify(clone)
-	l	%r6,24(%r15)		/* restore %r6 */
 	ltr	%r2,%r2			/* check return code */
-	jm	SYSCALL_ERROR_LABEL
 	jz	thread_start
+	l	%r6,24(%r15)		/* restore %r6 */
+	jm	SYSCALL_ERROR_LABEL
 	br	%r14
 error:
 	lhi	%r2,-EINVAL
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
index 5150540f4e..fdeb4c806f 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
@@ -43,10 +43,10 @@ ENTRY(__clone)
 	lg	%r5,168(%r15)		/* load child_tid from stack */
 	l	%r6,160(%r15)		/* load tls from stack */
 	svc	SYS_ify(clone)
-	lg	%r6,48(%r15)		/* restore %r6 */
 	ltgr	%r2,%r2			/* check return code */
-	jgm	SYSCALL_ERROR_LABEL
 	jz	thread_start
+	lg	%r6,48(%r15)		/* restore %r6 */
+	jgm	SYSCALL_ERROR_LABEL
 	br	%r14
 error:
 	lghi	%r2,-EINVAL