* 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.

	* resolv/Makefile (tests): Don't depend on
	$(objpfx)mtrace-tst-leaks when cross compiling.
This commit is contained in:
Roland McGrath 2003-03-01 22:32:04 +00:00
parent f88658e9b9
commit 7ed33cba81
4 changed files with 32 additions and 7 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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