NetBSD Problem Report #51964

From kre@munnari.OZ.AU  Sun Feb 12 05:22:13 2017
Return-Path: <kre@munnari.OZ.AU>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7D50A7A27F
	for <gnats-bugs@www.NetBSD.org>; Sun, 12 Feb 2017 05:22:13 +0000 (UTC)
Message-Id: <201702120522.v1C5Mwne000813@munnari.OZ.AU>
Date: Sun, 12 Feb 2017 12:22:58 +0700 (ICT)
From: kre@munnari.OZ.AU
To: gnats-bugs@www.NetBSD.org
Subject: kernel with ath driver does not link without options MODULAR
X-Send-Pr-Version: 3.95

>Number:         51964
>Category:       kern
>Synopsis:       kernel with ath driver does not link without options MODULAR
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 12 05:25:00 +0000 2017
>Last-Modified:  Sun Jun 03 07:55:00 +0000 2018
>Originator:     Robert Elz
>Release:        NetBSD 7.99.??
>Organization:
>Environment:
NetBSD onyx.coe.psu.ac.th 6.99.30 NetBSD 6.99.30 (ONYX-Dom0) #0: Mon Feb  3 19:26:44 ICT 2014  kre@onyx.coe.psu.ac.th:/usr/obj/current/kernels/amd64/ONYX-Dom0 amd64  (this is from an older kernel)
Architecture: x86_64
Machine: amd64
>Description:
	Note that much of this PR is guesswork, ...

	It appears as if the ath driver -  in particular,
		external/isc/atheros_hal/dist/ah.c
	requires linker information which is not generated
	for NetBSD kernels without "options MODULAR"

>How-To-Repeat:
	Create a kernel config file that does not contain
		options MODULAR
	(and does not include anything which has that) but
	which does contain the ath driver (my kernel config
	also contains athn but I doubt that is relevant.)

	I started with the amd64 XEN3_DOM0 kernel config,
	edited it to remove drivers (and other options) not
	relevant to the hardware it is to run on, and
	(as with all the kernels I ever run) removed MODULAR.

	This used to work fine in the past (though has not for
	quite a while now, - probably at least a year, and only
	in current, NetBSD 7* is still fine - I no longer have
	a record of when it first failed) but now produces ...

#      link  ONYX-Dom0/netbsd
/usr/obj/testing/tools/bin/x86_64--netbsd-ld -Map netbsd.map --cref -T netbsd.ldscript -Ttext 0xffffffff80200000 -e start -X -o netbsd ${SYSTEM_OBJ:[@]:Nswapnetbsd.o} ${EXTRA_OBJ} vers.o swapnetbsd.o
ah.o: In function `ath_hal_probe':
ah.c:(.text+0x10): undefined reference to `__start_link_set_ah_chips'
ah.o: In function `ath_hal_attach':
ah.c:(.text+0x71): undefined reference to `__start_link_set_ah_chips'
/usr/obj/testing/tools/bin/x86_64--netbsd-ld: netbsd: hidden symbol `__stop_link_set_ah_rfs' isn't defined
/usr/obj/testing/tools/bin/x86_64--netbsd-ld: final link failed: Bad value

*** Failed target:  netbsd

>Fix:
	No idea

	For now I have just deleted ath the drivers from the kernel
	config file...  they were only there so that some time in the
	future, when the relevant ath chpset becomes supported by NetBSD
	the wireless on this system would appear - not that it will be very
	useful, the wireless is bridged to the same net to which this
	system has Gbps wired connectivity...

>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51964: kernel with ath driver does not link without options
 MODULAR
Date: Sun, 3 Jun 2018 07:50:10 +0000

 It's coming from this part of ah_osdep.h

 #define OS_SET_DECLARE(set, ptype)	__link_set_decl(set, ptype)
 #define OS_DATA_SET(set, sym)		__link_set_add_rodata(set, sym)
 #define OS_SET_FOREACH(pvar, set)	__link_set_foreach(pvar, set)

 I hesitate to touch it without hardware to test it, because of
 ath_hal_probe's code.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.