Re: Fwd: binutils in debian unstable is broken.

Jakub Jelinek (jakub@redhat.com)
Wed, 5 Dec 2001 04:49:49 -0500


On Wed, Dec 05, 2001 at 08:43:39AM +0000, Alan Cox wrote:
> > The problem appears to be that the linker is now actually doing what
> > we asked it to do, so the `remove_foo' entry in that table now points
> > at a function which isn't going to be linked into the kernel. Oh dear.
>
> The ideal it seems would be for binutils to support passing a stub function
> to use in such cases. That would keep the kernel stuff working nicely and
> allow us to do panic("__exit code called"); if anyone actually did manage
> to call one.

In binutils? This sounds more like kernel should do it...
If all .text.exit functions were not static, it would be pretty easy to do,
but I guess they are usually static. In that case, I think it would take
about 1 day hacking an libelf program, which would rewrite all object files
which are going to be linked into vmlinux, which would add a new SHN_UND symbol to
each .symtab/.strtab (say __devexit_called) and change all relocs against
symbols in .text.exit sections to this symbol instead.
Maybe even it would take even less time, it is not that hard.

Jakub
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/