Re: Linux 2.5.60

From: Jeff Dike (
Date: Wed Feb 12 2003 - 23:12:38 EST said:
> Or it can use the linker to play games with symbol names to move the
> kernel off into it's own separate name space.
> This sounds like a good opportunity to figure out which makes most
> sense and future proof UML.

OK, I thought I had a cunning plan to deal with this problem, but it falls
apart when you actually think about it some.

The problem is this -
        2.5.60 introduces sigprocmask as a kernel function
        UML calls sigprocmask from its userspace code (the stuff that interacts
with libc rather than the kernel) and it expects to get the libc sigprocmask
which makes a system call into the host kernel
        Instead, it gets the new kernel sigprocmask, and things go downhill
rapidly from there

My cunning plan was this -
        link UML's userspace code into a single .o (call it userspace.o),
similarly link its kernel code into a single .o (kernel.o)
        do an incremental link of userspace.o against libc, thereby resolving
sigprocmask to the libc version
        link all of UML together, kernel code and userspace code. Any remaining
references to sigprocmask will be in kernel code, and will resolve to the new
kernel sigprocmask.

This falls apart for a couple of reasons -
        I get a duplicate definition of sscanf which I can't get rid of (libc
vs. lib/vsprintf.c)
        More seriously, this assumes a static link and breaks the dynamic build
of UML

In order for this to work, references from userspace.o which can be resolved
in libc must somehow survive the link against the kernel code unresolved.
That is, references to things not in libc must be resolved from kernel code
and references to things in libc must be resolved from libc even if there is
a symbol with the same name in the kernel. I don't see any way of doing this.

The only other solution I see is to rename the kernel sigprocmask. Oleg Drokin
has done with this with a
on kernel code compiles, and I've done it at link time with objcopy. This
sucks, but it does have the great advantage that it actually works.

Anyway, if there's something better, I really want to know about it.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:00:45 EST