NetBSD Problem Report #48543

From www@NetBSD.org  Thu Jan 23 11:16:40 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 2DFB0A646B
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 23 Jan 2014 11:16:40 +0000 (UTC)
Message-Id: <20140123111638.E76A3A648B@mollari.NetBSD.org>
Date: Thu, 23 Jan 2014 11:16:38 +0000 (UTC)
From: ozaki-r@iij.ad.jp
Reply-To: ozaki-r@iij.ad.jp
To: gnats-bugs@NetBSD.org
Subject: Fix modload failure on evbarm/BEAGLEBONE
X-Send-Pr-Version: www-1.0

>Number:         48543
>Category:       port-arm
>Synopsis:       Fix modload failure on evbarm/BEAGLEBONE
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 23 11:20:00 +0000 2014
>Closed-Date:    Thu Jan 23 11:47:09 +0000 2014
>Last-Modified:  Thu Jan 23 11:50:01 +0000 2014
>Originator:     Ryota Ozaki
>Release:        current
>Organization:
IIJ
>Environment:
# uname -a
NetBSD  6.99.29 NetBSD 6.99.29 (BEAGLEBONE) #114: Thu Jan 23 19:18:05 JST 2014  ozaki-r@(snip) evbarm

>Description:
Modules that use ffs cannot be modload-ed; modload fails with the following error:
  # modload nand
  kobj_checksyms, 880: [nand]: linker error: symbol `__ffssi2' not found
  WARNING: module error: unable to affix module `nand', error 8
  modload: Exec format error

The kernel binary includes ffs and __ffssi2 symbols, however, its code is not found.
>How-To-Repeat:
I guess we can reproduce the problem with any evbarm/BEAGLEBONE kernels.
>Fix:
Index: common/lib/libc/arch/arm/string/ffs.S
===================================================================
RCS file: /cvs/cvsroot/src/common/lib/libc/arch/arm/string/ffs.S,v
retrieving revision 1.6
diff -u -r1.6 ffs.S
--- common/lib/libc/arch/arm/string/ffs.S       30 Sep 2013 13:07:51 -0000      1.6
+++ common/lib/libc/arch/arm/string/ffs.S       23 Jan 2014 10:43:48 -0000
@@ -44,7 +44,7 @@
  * This is the ffs algorithm devised by d.seal and posted to comp.sys.arm on
  * 16 Feb 1994.
  */
-WEAK_ALIAS(__ffssi2,ffs)
+STRONG_ALIAS(__ffssi2,ffs)
 #if (defined(_ARM_ARCH_5) && !defined(__thumb__)) || defined(_ARM_ARCH_T2)
 #if defined(_ARM_ARCH_T2)
 ENTRY(ffs)

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-arm-maintainer->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Thu, 23 Jan 2014 11:47:09 +0000
Responsible-Changed-Why:
mine


State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Thu, 23 Jan 2014 11:47:09 +0000
State-Changed-Why:
Patch applied, thanks for the report!


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48543 CVS commit: src/common/lib/libc/arch/arm/string
Date: Thu, 23 Jan 2014 11:45:46 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Jan 23 11:45:46 UTC 2014

 Modified Files:
 	src/common/lib/libc/arch/arm/string: ffs.S

 Log Message:
 PR port-arm/48543: do provide __ffssi2 as strong alias (in case libgcc.a gets
 not linked in) for now.
 OK: skrll@


 To generate a diff of this commit:
 cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/arm/string/ffs.S

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>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.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.