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

Ulrich Drepper (drepper@cygnus.com)
31 Aug 1998 14:02:40 -0700


Martin Mares <mj@ucw.cz> writes:

> > It is not planned to use the LDT in non-threaded programs. It could
> > be but I'm not sure it's wise.
>
> Well, you could still use the NULL selector for non-threaded programs,
> still needing no LDT.

A NULL segment selector is illegal. You probably mean to use the same
value as in %ds.

This is possible. It would require a different approach than I use
now since currently the data is accessed through %gs at constant
offsets (which makes this quite efficent and the code compact). In
the case where the %ds value is used the offset (in my case the offset
of the thread descriptor) is non-constant. It is determined by the
descriptor for the main thread and the segment start addresses would
have to be adjusted appropriately.

The problem with this approach is that the functionality cannot be
fully exploited without a gcc extension. How would you defined errno?
It's no big problem in glibc itself but every program will have
problems.

And: if this approach ever should be realized there is no backward
compatibility. Programs compiled with the new errno definition cannot
run on old systems. The libc&friends must be compatible. Other
runtime environments (like FORTRAN etc) must provide the same setup.
Otherwise it would now be possible to use C written code in this
environments.

Altogether I'm not convinced this is a good idea. I'd like to keep
the knowledge about this local to glibc. Plus: one can then compile
glibc without these extensions, if necessary.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- 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