Subject: kern/36287: can't load lkm exec_*_elf.o and exec_pecoff.o, conflicting symbol `emul_find_root'.
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <tnozaki@netbsd.org>
List: netbsd-bugs
Date: 05/07/2007 13:40:01
>Number:         36287
>Category:       kern
>Synopsis:       can't load lkm exec_*_elf.o and exec_pecoff.o, conflicting symbol `emul_find_root'.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 07 13:40:00 +0000 2007
>Originator:     Takehiko NOZAKI
>Release:        4.99.19
>Organization:
>Environment:
NetBSD spooky.example.com 4.99.19 NetBSD 4.99.19 (SPOOKY) #0: Mon May  7 00:11:06 JST 2007 root@spooky.example.com:/usr/obj.i386/sys/arch/i386/compile/SPOOKY i386
>Description:
can't load lkm exec_*_elf.o and exec_pecoff.o
it seems that symbol 'emul_find_root' is conflicted between kernel with lkm.
>How-To-Repeat:
$ modload exec_linux_elf.o
exec_linux_elf.o: In function `emul_find_root':
: multiple definition of `emul_find_root'
ld: [1]   Segmentation fault (core dumped) ld -R /dev/ksyms...
modload: can't prelink `exec_linux_elf.o' creating `exec_linux_elf'
>Fix:
Index: sys/lkm/exec/freebsd_elf/Makefile
===================================================================
RCS file: /cvsroot/src/sys/lkm/exec/freebsd_elf/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- sys/lkm/exec/freebsd_elf/Makefile	29 Nov 2002 17:11:22 -0000	1.6
+++ sys/lkm/exec/freebsd_elf/Makefile	6 May 2007 15:47:00 -0000
@@ -12,7 +12,7 @@
 SRCS+=	freebsd_exec_elf32.c
 
 # compat_util.c symbol redifinitions
-CPPFLAGS+=	-Demul_find=freebsd_emul_find				\
+CPPFLAGS+=	-Demul_find_root=freebsd_emul_find_root			\
 		-Demul_find_interp=freebsd_emul_find_interp		\
 		-Dstackgap_init=freebsd_stackgap_init			\
 		-Demul_flags_translate=freebsd_emul_flags_translate	\
Index: sys/lkm/exec/linux_elf/Makefile
===================================================================
RCS file: /cvsroot/src/sys/lkm/exec/linux_elf/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- sys/lkm/exec/linux_elf/Makefile	11 Dec 2005 12:24:48 -0000	1.8
+++ sys/lkm/exec/linux_elf/Makefile	6 May 2007 15:47:00 -0000
@@ -22,7 +22,7 @@
 .endif
 
 # compat_util.c symbol redifinitions
-CPPFLAGS+=	-Demul_find=linux_elf_emul_find			\
+CPPFLAGS+=	-Demul_find_root=linux_elf_emul_find_root	\
 		-Demul_find_interp=linux_emul_find_interp	\
 		-Dstackgap_init=linux_stackgap_init 		\
 		-Demul_flags_translate=linux_elf_emul_flags_translate \
Index: sys/lkm/exec/pecoff/Makefile
===================================================================
RCS file: /cvsroot/src/sys/lkm/exec/pecoff/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- sys/lkm/exec/pecoff/Makefile	29 Nov 2002 17:11:22 -0000	1.4
+++ sys/lkm/exec/pecoff/Makefile	6 May 2007 15:47:00 -0000
@@ -14,7 +14,7 @@
 SRCS+=	pecoff_exec.c
 
 # compat_util.c symbol redifinitions
-CPPFLAGS+=	-Demul_find=pecoff_emul_find				\
+CPPFLAGS+=	-Demul_find_root=pecoff_emul_find_root			\
 		-Demul_find_interp=pecoff_emul_find_interp		\
 		-Dstackgap_init=pecoff_stackgap_init			\
 		-Demul_flags_translate=pecoff_emul_flags_translate	\
Index: sys/lkm/exec/svr4_elf/Makefile
===================================================================
RCS file: /cvsroot/src/sys/lkm/exec/svr4_elf/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- sys/lkm/exec/svr4_elf/Makefile	29 Nov 2002 17:11:23 -0000	1.7
+++ sys/lkm/exec/svr4_elf/Makefile	6 May 2007 15:47:00 -0000
@@ -19,7 +19,7 @@
 SRCS+=	svr4_exec_elf${ELFSIZE}.c
 
 # compat_util.c symbol redifinitions
-CPPFLAGS+=	-Demul_find=svr4_emul_find				\
+CPPFLAGS+=	-Demul_find_root=svr4_emul_find_root			\
 		-Demul_find_interp=svr4_emul_find_interp		\
 		-Dstackgap_init=svr4_stackgap_init			\
 		-Demul_flags_translate=svr4_emul_flags_translate	\