diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2009-07-13 05:14:24 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-08-03 12:52:42 -0400 |
commit | 0e66fff883ef1b6e4c5031e8add8827cd0e2a195 (patch) | |
tree | 8401cb60cc59c1bc77fa46fadf42d164219f9aba /arch/mips/kernel | |
parent | d8e5f9fe5dab0e07985f2456cb6cc57788f53131 (diff) |
MIPS: Fix loading of modules with unresolved weak symbols
Loading of modules with unresolved weak symbols fails on MIPS
since '88173507e4fc1e7ecd111b0565e8cba0cb7dae6d'.
Modules: handle symbols that have a zero value
The module subsystem cannot handle symbols that are zero. If symbols
are present that have a zero value then the module resolver prints out a
message that these symbols are unresolved.
We have to use IS_ERR_VALUE() to check that a symbol has been resolved
or not.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/module.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c index 3e9100dcc12d..e465851a6163 100644 --- a/arch/mips/kernel/module.c +++ b/arch/mips/kernel/module.c | |||
@@ -301,7 +301,7 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, | |||
301 | /* This is the symbol it is referring to */ | 301 | /* This is the symbol it is referring to */ |
302 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr | 302 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr |
303 | + ELF_MIPS_R_SYM(rel[i]); | 303 | + ELF_MIPS_R_SYM(rel[i]); |
304 | if (!sym->st_value) { | 304 | if (IS_ERR_VALUE(sym->st_value)) { |
305 | /* Ignore unresolved weak symbol */ | 305 | /* Ignore unresolved weak symbol */ |
306 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) | 306 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) |
307 | continue; | 307 | continue; |
@@ -341,7 +341,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, | |||
341 | /* This is the symbol it is referring to */ | 341 | /* This is the symbol it is referring to */ |
342 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr | 342 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr |
343 | + ELF_MIPS_R_SYM(rel[i]); | 343 | + ELF_MIPS_R_SYM(rel[i]); |
344 | if (!sym->st_value) { | 344 | if (IS_ERR_VALUE(sym->st_value)) { |
345 | /* Ignore unresolved weak symbol */ | 345 | /* Ignore unresolved weak symbol */ |
346 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) | 346 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) |
347 | continue; | 347 | continue; |