NetBSD Problem Report #41195

From root@firewall1.totaltech.ro  Mon Apr 13 09:17:32 2009
Return-Path: <root@firewall1.totaltech.ro>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id F374E63B8A5
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 13 Apr 2009 09:17:31 +0000 (UTC)
Message-Id: <20090413074627.474896B4830@firewall1.totaltech.ro>
Date: Mon, 13 Apr 2009 10:46:09 +0300 (EEST)
From: mihai.chelaru@ngnetworks.ro
Reply-To: mihai.chelaru@ngnetworks.ro
To: gnats-bugs@gnats.NetBSD.org
Subject: NetBSD 5 can't load kernel modules
X-Send-Pr-Version: 3.95

>Number:         41195
>Category:       kern
>Synopsis:       NetBSD 5 RC3 can't load kernel modules
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 13 09:20:00 +0000 2009
>Closed-Date:    Tue Nov 27 20:58:12 +0000 2018
>Last-Modified:  Tue Nov 27 20:58:12 +0000 2018
>Originator:     Mihai Chelaru
>Release:        NetBSD 5.0_RC3
>Organization:

>Environment:


System: NetBSD xxx.xxx.xxx 5.0_RC3 NetBSD 5.0_RC3 (XXX) #0: Tue Apr 7 17:22:07 EEST 2009 root@xxx.xxx.xxx:/usr/src/sys/arch/i386/compile/XXX i386
Architecture: i386
Machine: i386
>Description:

	I am not able to load a kernel module (lkm or kmod) in NetBSD 5 RC3.

	Note: Unless I am doing something terribly wrong here, this is an
	important regression and should be hilighted in release notes if
	it will remain in current state.

>How-To-Repeat:

# modload /usr/lkm/udf.o 2>&1 | head
/usr/lkm/udf.o: In function `udf_lkmentry':
: undefined reference to `lkm_nofunc'
/usr/lkm/udf.o: In function `udf_lkmentry':
: undefined reference to `lkm_nofunc'
/usr/lkm/udf.o: In function `udf_lkmentry':
: undefined reference to `lkmdispatch'
/usr/lkm/udf.o: In function `udf_lkmentry':
: undefined reference to `lkm_nofunc'
/usr/lkm/udf.o: In function `udf_lkmentry':
: undefined reference to `lkmdispatch'
# modload /stand/i386/5.0_RC3/modules/udf/udf.kmod
modload: module object must end in .o
# 


>Fix:


>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->analyzed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Sun, 19 Apr 2009 02:27:47 +0000
State-Changed-Why:
i can reproduce this problem quite easily.

you can work around it by passing "-A /netbsd" (or your real kernel image)
to modload.

the difference is that /dev/ksyms has absolute symbols, and /netbsd has
data/text symbols, and ld(1) doesn't like that.

i tried applying this change from ad@ but it did not change the error:

Module Name:    src
Committed By:   ad
Date:           Fri Dec  5 21:38:10 UTC 2008

Modified Files:
        src/sys/kern: kern_ksyms.c
        src/sys/sys: ksyms.h

Log Message:
Make the fake ELF object work with gdb.

- Output a .bss section and make all the symbols relative to it, instead
  of making them absolute.
- Output a single load section, no need for two.

'gdb /dev/ksyms' still doesn't work because ksyms doesn't do mmap yet.

To generate a diff of this commit:
cvs rdiff -r1.47 -r1.48 src/sys/kern/kern_ksyms.c
cvs rdiff -r1.21 -r1.22 src/sys/sys/ksyms.h


State-Changed-From-To: analyzed->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 27 Nov 2018 20:58:12 +0000
State-Changed-Why:
This is definitely fixed now.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.