Fix short allocation in libc RTLD for static-compiled programs.
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 28 Apr 2009 23:49:30 +0000 (16:49 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 28 Apr 2009 23:49:30 +0000 (16:49 -0700)
commit97c6bef24f04b2a2e7f1ab1661a62fd053ac071e
tree0f9a39c3319f0de30c562c790c8ff29e2c48d490
parentebee5c9b0d991169e7ae518b2a47617ff9456b54
Fix short allocation in libc RTLD for static-compiled programs.

libc's __libc_allocate_tls() (weakly bound to _rtld_allocate_tls()) was not
allocating enough space for the TLS segments in statically-compiled
threaded applications.

The old malloc allocated lots of extra space and masked the bug.  The new
slab malloc doesn't and revealed the bug.

Reproduced-by: Sepherosa Ziehau <sepherosa@gmail.com>
lib/libc/gen/tls.c