linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: fix loading of modules with unresolved weak symbols
@ 2009-07-13  9:14 Gabor Juhos
  2009-07-13 10:57 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Gabor Juhos @ 2009-07-13  9:14 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips@linux-mips.org, Gabor Juhos

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>
---
 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 3e9100d..e465851 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,
 		/* This is the symbol it is referring to */
 		sym = (Elf_Sym *)sechdrs[symindex].sh_addr
 			+ ELF_MIPS_R_SYM(rel[i]);
-		if (!sym->st_value) {
+		if (IS_ERR_VALUE(sym->st_value)) {
 			/* Ignore unresolved weak symbol */
 			if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
 				continue;
@@ -341,7 +341,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
 		/* This is the symbol it is referring to */
 		sym = (Elf_Sym *)sechdrs[symindex].sh_addr
 			+ ELF_MIPS_R_SYM(rel[i]);
-		if (!sym->st_value) {
+		if (IS_ERR_VALUE(sym->st_value)) {
 			/* Ignore unresolved weak symbol */
 			if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
 				continue;
-- 
1.5.3.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: fix loading of modules with unresolved weak symbols
  2009-07-13  9:14 [PATCH] MIPS: fix loading of modules with unresolved weak symbols Gabor Juhos
@ 2009-07-13 10:57 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2009-07-13 10:57 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: linux-mips@linux-mips.org

On Mon, Jul 13, 2009 at 11:14:24AM +0200, Gabor Juhos wrote:

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

Applied.  Thanks Gabor!

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-13 10:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-13  9:14 [PATCH] MIPS: fix loading of modules with unresolved weak symbols Gabor Juhos
2009-07-13 10:57 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).