summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--elf/dl-reloc.c18
-rw-r--r--stdlib/stdlib.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h1
4 files changed, 32 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 024df1c069..e35228fe72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
+2003-03-01  Roland McGrath  <roland@redhat.com>
+
+	* elf/dl-reloc.c (allocate_static_tls): Fix calculations.
+	From Jakub Jelinek <jakub@redhat.com>.
+
+	* sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Revert last change,
+	which duplicated the O_DIRECT defn.
+
+2003-03-01  GOTO Masanori  <gotom@debian.or.jp>
+
+	* stdlib/stdlib.h: Add missing __USE_BSD enclosure for BSD derived
+	random functions.
+
 2003-03-01  Andreas Schwab  <schwab@suse.de>
 
+	* resolv/Makefile (tests): Don't depend on
+	$(objpfx)mtrace-tst-leaks when cross compiling.
+
 	* sysdeps/m68k/dl-machine.h (_dl_start_user): Access
 	__libc_stack_end through GOT since it is a global symbol.
 
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 0443011b36..ad6c00cd64 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -44,23 +44,31 @@
 static void __attribute_noinline__
 allocate_static_tls (struct link_map *map)
 {
-  size_t offset = roundup (GL(dl_tls_static_used), map->l_tls_align);
-  if (offset + map->l_tls_blocksize
+  size_t offset, used, check;
+
 # if TLS_TCB_AT_TP
-      + TLS_TCB_SIZE
+  offset = roundup (GL(dl_tls_static_used) + map->l_tls_blocksize,
+		    map->l_tls_align);
+  used = offset;
+  check = offset + TLS_TCB_SIZE;
 # elif TLS_DTV_AT_TP
+  offset = roundup (GL(dl_tls_static_used), map->l_tls_align);
+  used = offset + map->l_tls_blocksize;
+  check = used;
   /* dl_tls_static_used includes the TCB at the beginning.  */
 # else
 #  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
 # endif
-      > GL(dl_tls_static_size))
+
+  if (check > GL(dl_tls_static_size))
     {
       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;
+  GL(dl_tls_static_used) = used;
 }
 #endif
 
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 6ab675fc57..87b559abc0 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -410,7 +410,9 @@ extern char *l64a (long int __n) __THROW;
 /* Read a number from a string S in base 64 as above.  */
 extern long int a64l (__const char *__s) __THROW __attribute_pure__;
 
+#endif	/* Use SVID || extended X/Open.  */
 
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
 # include <sys/types.h>	/* we need int32_t... */
 
 /* These are the functions that actually do things.  The `random', `srandom',
@@ -463,7 +465,7 @@ extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
 extern int setstate_r (char *__restrict __statebuf,
 		       struct random_data *__restrict __buf) __THROW;
 # endif	/* Use misc.  */
-#endif	/* Use SVID || extended X/Open.  */
+#endif	/* Use SVID || extended X/Open || BSD. */
 
 
 __BEGIN_NAMESPACE_STD
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
index 342fc6548f..98608c554f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
@@ -45,7 +45,6 @@
 # define O_DIRECT	0400000	/* Direct disk access.	*/
 # define O_DIRECTORY	 040000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0100000	/* Do not follow links.	 */
-# define O_DIRECT	0400000 /* Direct disk access.  */
 #endif
 
 #ifdef __USE_LARGEFILE64