From: Mark Seaborn Date: Tue, 9 Jun 2009 20:45:53 +0000 (+0100) Subject: Allocate a larger TLS segment, so that initialising libpthread.so works X-Git-Tag: nacl-dynlink-0.1~3 X-Git-Url: https://repo.or.cz/w/glibc/nacl-glibc.git/commitdiff_plain/5e4db8d16837b2532eca14cb66002e4235fcf519 Allocate a larger TLS segment, so that initialising libpthread.so works Normally on Linux, the TLS segment is unbounded. Before, under NaCl, only 100 bytes were allocated. Increase this to 4k so that __pthread_initialize_minimal works; it does "mov %eax,%gs:0x16c". This is not a proper fix: we should really allocate upto the top of address space. --- diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h index 3537123b1c..403748e64e 100644 --- a/nptl/sysdeps/i386/tls.h +++ b/nptl/sysdeps/i386/tls.h @@ -208,7 +208,7 @@ union user_desc_init INIT_SYSINFO; \ static int (*nacl_tls_init)(void const *buf, size_t size) = \ NACL_SYSCALL_ADDR(NACL_sys_tls_init); \ - _result = nacl_tls_init (_thrdescr, 100); \ + _result = nacl_tls_init (_thrdescr, 0x1000); \ _result == 0 ? NULL \ : "tls_init failed when setting up thread-local storage\n"; })