Root/target/linux/generic-2.6/patches-2.6.30/026-mips_fix_loading_of_modules_with_unresolved_weak_sy.patch

1From 819b4bda18d62b52d04789c4a8d4fc3fbf9ce242 Mon Sep 17 00:00:00 2001
2From: Gabor Juhos <juhosg@openwrt.org>
3Date: Mon, 13 Jul 2009 10:46:49 +0200
4Subject: [PATCH] MIPS: fix loading of modules with unresolved weak symbols
5
6Loading of modules with unresolved weak symbols fails on MIPS
7since '88173507e4fc1e7ecd111b0565e8cba0cb7dae6d'.
8
9Modules: handle symbols that have a zero value
10
11The module subsystem cannot handle symbols that are zero. If symbols
12are present that have a zero value then the module resolver prints out a
13message that these symbols are unresolved.
14
15We have to use IS_ERR_VALUE() to check that a symbol has been resolved
16or not.
17
18Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
19---
20 arch/mips/kernel/module.c | 4 ++--
21 1 files changed, 2 insertions(+), 2 deletions(-)
22
23--- a/arch/mips/kernel/module.c
24+++ b/arch/mips/kernel/module.c
25@@ -303,7 +303,7 @@ int apply_relocate(Elf_Shdr *sechdrs, co
26         /* This is the symbol it is referring to */
27         sym = (Elf_Sym *)sechdrs[symindex].sh_addr
28             + ELF_MIPS_R_SYM(rel[i]);
29- if (!sym->st_value) {
30+ if (IS_ERR_VALUE(sym->st_value)) {
31             /* Ignore unresolved weak symbol */
32             if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
33                 continue;
34@@ -343,7 +343,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs
35         /* This is the symbol it is referring to */
36         sym = (Elf_Sym *)sechdrs[symindex].sh_addr
37             + ELF_MIPS_R_SYM(rel[i]);
38- if (!sym->st_value) {
39+ if (IS_ERR_VALUE(sym->st_value)) {
40             /* Ignore unresolved weak symbol */
41             if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
42                 continue;
43

Archive Download this file



interactive