This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fix .tls_common handling in ld -r
On Thu, Jun 15, 2006 at 04:50:40PM +0200, Jakub Jelinek wrote:
> 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.
You can put the test in ld-elf and limit it to those targets with
TLS support. There are many cases in ld-elf.
H.J.