All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix modpost segfault for 64bit mipsel kernel
@ 2006-04-17 12:00 Atsushi Nemoto
  2006-04-17 12:53 ` Thiemo Seufer
  2006-04-17 13:40 ` Sam Ravnborg
  0 siblings, 2 replies; 13+ messages in thread
From: Atsushi Nemoto @ 2006-04-17 12:00 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf, sam

64bit mips has different r_info layout.  This patch fixes modpost
segfault for 64bit little endian mips kernel.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index cd00e9f..7846600 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -712,7 +712,13 @@ static void check_sec_ref(struct module 
 			r.r_offset = TO_NATIVE(rela->r_offset);
 			r.r_info   = TO_NATIVE(rela->r_info);
 			r.r_addend = TO_NATIVE(rela->r_addend);
+#if KERNEL_ELFCLASS == ELFCLASS64 && KERNEL_ELFDATA == ELFDATA2LSB
+			sym = elf->symtab_start +
+				(hdr->e_machine == EM_MIPS ?
+				 (Elf32_Word)r.r_info : ELF_R_SYM(r.r_info));
+#else
 			sym = elf->symtab_start + ELF_R_SYM(r.r_info);
+#endif
 			/* Skip special sections */
 			if (sym->st_shndx >= SHN_LORESERVE)
 				continue;

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

end of thread, other threads:[~2006-04-21 13:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-17 12:00 [PATCH] fix modpost segfault for 64bit mipsel kernel Atsushi Nemoto
2006-04-17 12:53 ` Thiemo Seufer
2006-04-17 14:07   ` Thiemo Seufer
2006-04-17 15:47     ` Atsushi Nemoto
2006-04-17 16:27       ` Thiemo Seufer
2006-04-19  2:22         ` Atsushi Nemoto
2006-04-20  0:19           ` Thiemo Seufer
2006-04-20 16:02             ` Atsushi Nemoto
2006-04-20 16:23               ` Thiemo Seufer
2006-04-20 17:05                 ` Atsushi Nemoto
2006-04-21 13:57                   ` Thiemo Seufer
2006-04-17 13:40 ` Sam Ravnborg
2006-04-17 16:03   ` Atsushi Nemoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.