Allocate a larger TLS segment, so that initialising libpthread.so works
authorMark Seaborn <mrs@mythic-beasts.com>
Tue, 9 Jun 2009 20:45:53 +0000 (9 21:45 +0100)
committerMark Seaborn <mrs@mythic-beasts.com>
Tue, 9 Jun 2009 20:45:53 +0000 (9 21:45 +0100)
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.

nptl/sysdeps/i386/tls.h

index 3537123..403748e 100644 (file)
@@ -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"; })