summary refs log tree commit diff
path: root/elf/dl-reloc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-30 18:04:01 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-30 18:04:01 +0000
commit567678b68514f1673f5f856ca1f280addf38cb88 (patch)
treedb0cd87c0c8fdd8117e707b0a58bc9005527fec2 /elf/dl-reloc.c
parent5df8349b84a85dee067380ad4a5c3b90148a6504 (diff)
downloadglibc-567678b68514f1673f5f856ca1f280addf38cb88.tar.gz
glibc-567678b68514f1673f5f856ca1f280addf38cb88.tar.xz
glibc-567678b68514f1673f5f856ca1f280addf38cb88.zip
Update.
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.
Diffstat (limited to 'elf/dl-reloc.c')
-rw-r--r--elf/dl-reloc.c24
1 files changed, 11 insertions, 13 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;