From a816b435dd0b8dde7dc2f8d995bd290998801317 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 5 Aug 2002 01:21:25 +0000 Subject: * Makerules (cpp-srcs-left): When setting this to run cppflags-iterator.mk, must append .c to $(tests) and $(xtests) words. Combine the two loops into one on the concatenated list, including those as well as $(test-srcs). * elf/dl-minimal.c (__libc_memalign): Guts of malloc moved here, since we align here with optimally minimal waste anyway. (malloc): Just call that. * sysdeps/generic/libc-tls.c (__libc_setup_tls): Set l_tls_offset to the right variable. * elf/dl-load.c (_dl_map_object_from_fd): Use p_vaddr, not p_offset, to compute memory location for l_tls_initimage. * elf/rtld.c (_dl_start): Likewise. * sysdeps/generic/libc-tls.c (__libc_setup_tls): Likewise. * libio/oldiopopen.c: Move #include's before #if SHLIB_COMPAT, because the .d file is generated in the non-shared case and so fails to catch them otherwise. * sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage): New function, split out of _dl_allocate_tls. (_dl_allocate_tls_init): Likewise. (_dl_allocate_tls): Call those. * sysdeps/generic/ldsodefs.h: Declare them with attribute_hidden. * elf/rtld.c (dl_main): Call them separately instead of calling _dl_allocate_tls. Delay _dl_allocate_tls_init until after relocation is finished, so that the initializer data has been relocated before we copy it into the main thread's TLS block. * sysdeps/generic/dl-tls.c (_dl_allocate_tls): Fix off-by-one error in loop conditions, prevented the last used module from being initialized. --- elf/dl-load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'elf/dl-load.c') diff --git a/elf/dl-load.c b/elf/dl-load.c index 2955bc5173..aabbf21128 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -949,7 +949,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp, l->l_tls_initimage_size = ph->p_filesz; /* Since we don't know the load address yet only store the offset. We will adjust it later. */ - l->l_tls_initimage = (void *) ph->p_offset; + l->l_tls_initimage = (void *) ph->p_vaddr; /* Assign the next available module ID. */ l->l_tls_modid = _dl_next_tls_modid (); -- cgit v1.2.3