Date: Sat, 5 Mar 2011 19:50:05 +1100 From: Peter Jeremy <peterjeremy@acm.org> To: freebsd-stable@freebsd.org Subject: Linker set issues with ath(4) HALs Message-ID: <20110305085004.GA70142@server.vk2pj.dyndns.org>
next in thread | raw e-mail | index | archive | help
--WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I have a Atheros AR5424 and so, based on the 8.2-STABLE i386 NOTES and some rummaging in the sources, I tried to build a kernel with: device ath # Atheros pci/cardbus NIC's device ath_ar5212 # HAL for Atheros AR5212 and derived chips device ath_rate_sample # SampleRate tx rate control for ath and this died during the kernel linking with: linking kernel.debug ah.o(.text+0x23c): In function `ath_hal_rfprobe': /usr/src/sys/dev/ath/ath_hal/ah.c:142: undefined reference to `__start_set_= ah_rf s' ah.o(.text+0x241):/usr/src/sys/dev/ath/ath_hal/ah.c:142: undefined referenc= e to `__stop_set_ah_rfs' ah.o(.text+0x25a):/usr/src/sys/dev/ath/ath_hal/ah.c:142: undefined referenc= e to `__stop_set_ah_rfs' Following a suggestion by a friend, I changed that to: device ath # Atheros pci/cardbus NIC's options AH_SUPPORT_AR5416 device ath_hal # Atheros HAL device ath_rate_sample # SampleRate tx rate control for ath and it worked. Normally, I would leave it at that but I'd like to understand what is actually going on... In both cases, ah.o contains the following 4 references: U __start_set_ah_chips U __start_set_ah_rfs U __stop_set_ah_chips U __stop_set_ah_rfs generated by: /* linker set of registered chips */ OS_SET_DECLARE(ah_chips, struct ath_hal_chip); /* linker set of registered RF backends */ OS_SET_DECLARE(ah_rfs, struct ath_hal_rf); These symbols do not appear in any other .o files, though there are a variety of other __{start,stop}_set_* symbols - all of which show up as 'A' (absolule) values in the final kernel. My questions are: How are these linker set references resolved? I can't find anything that defines these symbols - either in .o files or in ldscript files. In the first case, there are 2 pairs of undefined linker set variables but the linker only reports one pair as unresolved. Why don't both sets show up as resolved or unresolved? Why does using the generic "ath_hal", rather than the hardware-specific HAL fix the problem? --=20 Peter Jeremy --WIyZ46R2i8wDzkSu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAk1x+TwACgkQ/opHv/APuIc9bwCfZlMA9KvNRaAL72TlrtiiUamg /JUAoJLAWxCwhFB6oazoJ3V+ik9KzHQ1 =DrPH -----END PGP SIGNATURE----- --WIyZ46R2i8wDzkSu--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110305085004.GA70142>