This diff adds the bare necessary bits to ld.so to enable support for
thread-local-storage.  Compile and install this first, taking extra
caution when installing ld.so (have a root shell open, copy ld.so to
ld.so.good beforehand, etc)  If there's a mismatch with your kernel or the
built ld.so is bad, life gets hard.

Philip
--
Note: this diff was taken from an email exchange from about Sep 21 2011
I think this is what's missing on i386. Now it works for me as well. :)
--
Diff from email exchange Sep 29, 2011
Bump shared libraries, make ld.so functions visible.
proper ifdef not if __foobar__
Do not intialize dynamic linker internal data fields.
TPOFF64 relocation and DTPMOD/DTPOFF relocation changes

These appear to match the freebsd dynamic linker now.
Additional debug code for tls allocation.
allocation max_index +2 to match FreeBSD.

do not conditionally set up segbase[0] this is Variant 2 specific code
Do not clobber ld.so configured tls struct.

Allow code to detect if ld.so has not set up tls and
default to intial_thread version.
Stub functions to allow pthread_create if statically linked.
libpthread and libc bump major due to tls
TLS test code from freebsd.
Initial arm TLS pieces.
Test program to verify that relocations occur before TLS allocation
Allocate initial TLS object after relocations are performed.
Cleanup regression test output.