lkml.org 
[lkml]   [2003]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [MODULES] fix weak symbol handling
Date
In message <20030113110036.A873@twiddle.net> you write:
> case SHN_UNDEF:
> + sym[i].st_value
> + = resolve_symbol(sechdrs, symindex, strtab,
> + strtab + sym[i].st_name, mod);
> +
> + /* Ok if resolved. */
> + if (sym[i].st_value != 0)
> + break;
> + /* Ok if weak. */
> + if (ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
> + break;
> +
> + printk(KERN_WARNING "%s: Unknown symbol %s\n",
> + mod->name, strtab + sym[i].st_name);
> + ret = -ENOENT;
> break;

I don't understand this. For a weak symbol, st_shndx won't be
SHN_UNDEF. And you don't want to set its value to 0, anyway. I think
you want:

default:
if (ELF_ST_BIND(sym[i].st_info) == STB_WEAK) {
unsigned long val = resolve_symbol(...);
if (val)
sym[i].st_value = val;
} else
...

Or am I missing something?
Rusty.
PS. "s/Fix weak symbol handling/Implement weak symbol handling/" 8)
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
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:32    [W:0.068 / U:6.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site