Pthread patches for TLS

Doug Rabson dfr at
Thu Aug 5 07:53:59 PDT 2004

I haven't tried to support static linked TLS at all. The plan is to get 
the kernel to size the TLS segment and add extra AUXARGs to report its 
size, initialiser location and alignment. The stubs in libc/gen/tls.c 
would be extended to provide support for allocating the TLS blocks in 
the static case.

I was under the impression that no-one particularly wanted to support 
pthreads in statically linked binaries?

On Thursday 05 August 2004 15:48, David Xu wrote:
> This patch does not work for statically linked binary even if the
> binary does
> not use __thread, I think you still need to use malloc to allocate
> memory for tcb if it is being compiled as a static library.
> I have tested it on AMD64, dynamically linked binary works fine.
> David Xu
> Doug Rabson wrote:
> >This is the current state of my patches to add TLS support to
> > libpthread and libthr. I have added code for i386, amd64 and ia64
> > but I've only tested i386. I believe the code for amd64 is right. I
> > don't much like what I've done to the ia64 version though. I would
> > like to commit only the i386 version at this stage. The amd64 code
> > could be committed if someone tests it.

More information about the freebsd-threads mailing list