[PATCH] Fix .tls_common handling in ld -r

Jakub Jelinek jakub@redhat.com
Thu Jun 15 14:56:00 GMT 2006


On Thu, Jun 15, 2006 at 07:40:59AM -0700, H. J. Lu wrote:
> On Thu, Jun 15, 2006 at 03:04:02PM +0200, Jakub Jelinek wrote:
> > Hi!
> > 
> > cat > a.c <<EOF
> > __asm (".tls_common foo,4,4");
> > 
> > int
> > main (void)
> > {
> >   extern __thread int foo;
> >   return foo;
> > }
> > EOF
> > gcc -c a.c
> > ld -r -o b.o a.o
> > gcc -o b b.o
> 
> Can you add a testcase?

We don't have yet any checks in the testsuite whether the compiler
supports __thread.  But, perhaps just compiling/ld -r'ing/linking
__asm (".tls_common foo,4,4");
int main (void) { return 0; }
would be enough.  But then again, we need some test to see whether
the target supports TLS at all.  The current TLS tests are all in
ld-<cpu>/ ATM, but this test isn't arch specific.

	Jakub



More information about the Binutils mailing list