Re: patch for x86 treatment of fs and gs in signal handlers

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Tue, 1 Sep 1998 18:34:53 +0100


Ulrich Drepper wrote:
> But this is not usable since the intent is to have the segments
> associated with %fs and %gs not to have the same address as the
> segments for %ds etc.

No. Your supposition that the standard address is emitted by GCC is
correct. The %gs-relative offsets are handled by ld.so, by run-time
relocation. These offsets cannot be known at link time (except perhaps
for one shared object, Glibc or the main executable) because they depend
on which shared libraries are loaded.

For -fPIC code, the offsets go in the offset table as usual, so this
doesn't break the page sharing advantages of PIC.

> No, I'm not changing ld.so for this.

Don't you have to do something similar anyway, if libraries other than
libc.so are to use %gs-offset for their thread-local variables?

Or is this efficient trick going to be reserved exclusively for Glibc's
internal use?

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html