lkml.org 
[lkml]   [2001]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fwd: binutils in debian unstable is broken.

On Wed, 5 Dec 2001, 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.

We can get a panic() call (and remove the ugly #ifdef's) with
something like this:

in some .h file:

#ifdef DEVEXIT_LINKED
#define DEVEXIT_FUNC(a) (a)
#else
void panic_exit_code();
#define DEVEXIT_FUNC(a) ((typeof((a)) *)panic_exit_code)
#endif

in some .c file:

#ifndef DEVEXIT_LINKED
void panic_exit_code()
{
panic("__exit code called");
}
#endif

change the drivers like this:

#ifdef DEVEXIT_LINKED
remove: firestream_remove_one,
#endif

to this:

remove: DEVEXIT_FUNC(firestream_remove_one),


Eric


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:13    [from the cache]
©2003-2011 Jasper Spaans