This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fix i386 GD->IE TLS transition
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 23 Jun 2006 09:26:52 -0700
- Subject: Re: [PATCH] Fix i386 GD->IE TLS transition
- References: <20060623140051.GS3823@sunsite.mff.cuni.cz>
On Fri, Jun 23, 2006 at 04:00:51PM +0200, Jakub Jelinek wrote:
> Hi!
>
> #!/bin/sh
> CFLAGS="-g -m32 -O2"
> gcc $CFLAGS -fpic -c -o a.o -xc - <<EOF
> extern __thread int data; extern int *foo (void); extern void abort (void);
> int main (void) { if (foo () != &data) abort (); return 0; }
> EOF
> gcc $CFLAGS -c -o b.o -xc - <<EOF
> extern __thread int data;
> int *foo (void) { return &data; }
> EOF
> echo '__thread int data;' | gcc $CFLAGS -c -o c.o -xc -
> gcc $CFLAGS -Wl,--export-dynamic -o test a.o b.o c.o
> ./test; echo $?
>
> is mis-linked, as the GOT slot contains R_386_TPOFF value (0xfffffffc),
> but the code in main subtracts this value from %gs:0 rather than adds to it.
>
> Apparently H.J. was trying to fix this two months ago, but the fix was both
> insufficient and flawed.
I can't duplicate the failure with the testcase above.
H.J.