lkml.org 
[lkml]   [2009]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: module version magic and arches with symbol prefixes
Date
On Fri, 19 Jun 2009 12:54:44 am Mike Frysinger wrote:
> the current check_modstruct_version() does this:
> {
> const unsigned long *crc;
>
> if (!find_symbol("module_layout", NULL, &crc, true, false))
> BUG();
> return check_version(sechdrs, versindex, "module_layout", mod, crc);
> }
> the trouble here is that it looks for a literal "module_layout" symbol
> and for ports that have symbol prefixes (a quick check shows Blackfin
> & h8300), this aint going to work.

MODULE_SYMBOL_PREFIX is the fix for this, ie:

if (!find_symbol(MODULE_SYMBOL_PREFIX "module_layout), ...

> also, using BUG() here seems pretty damn harsh. wouldnt it make more
> sense to do something like:
> if (WARN_ON(!find_symbol("module_layout", NULL, &crc, true, false)))
> return 0;
> this way the module is simply not loaded rather than killing the kernel

No, it means the kernel didn't build properly. Better to fail spectacularly:
ideally we'd do this find in an init routine and guarantee a boot crash.

Thanks,
Rusty.


\
 
 \ /
  Last update: 2009-06-19 08:37    [W:0.059 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site