From owner-freebsd-current@FreeBSD.ORG Mon May 21 08:41:28 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50D221065696; Mon, 21 May 2012 08:41:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id C5CFB8FC19; Mon, 21 May 2012 08:41:27 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4L8bZEd024259; Mon, 21 May 2012 11:37:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4L8bX56013606; Mon, 21 May 2012 11:37:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4L8bXZ7013605; Mon, 21 May 2012 11:37:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 21 May 2012 11:37:33 +0300 From: Konstantin Belousov To: Hartmut Brandt Message-ID: <20120521083733.GS2358@deviant.kiev.zoral.com.ua> References: <201205210651.q4L6pLYI084136@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PpHgzJIASOO9qXt6" Content-Disposition: inline In-Reply-To: <201205210651.q4L6pLYI084136@freefall.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean Cc: current@freebsd.org Subject: Re: clang+VNET -> netstat: no namelist X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 08:41:28 -0000 --PpHgzJIASOO9qXt6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 21, 2012 at 06:51:21AM +0000, Hartmut Brandt wrote: > Hi, >=20 > I'm running a kernel+world compiled with clang (everything fresh from two > days ago). Kernel and world are in sync. When I run netstat -rn I get a > 'no namelist'. >=20 > I tried to track that down and it looks like this is an issue with the sy= mbol > dumptid defined in kern_shutdown. libkvm tries to look up this symbol when > it figures out whether it needs to do a second run on a symbol list with > all the symbols that have not been found prefixed by vnet_. the kldsym > system call fails to lookup this symbol when the kernel is compiled with = clang > and hence libkvm fails to recognize the VNET kernel. >=20 > I 'fixed' this by making dumptid non-static, but I wonder how a static > symbol can be returned by kldsym in the gcc case. To me this looks > not entirely useful. >=20 > Maybe someone with more knowledge of the kernel symbol stuff has an idea > of a real fix. I think making dumptid not-static is the right thing to do, if it is indeed looked up by external consumer. The kernel linkers use the normal symbol table, and not the dynamic symbol table. Taking aside the reasons for this choice, it just so happens that our version of gcc does not optimize out the assign-only static dumptid variable. Clang is more aggressive and dumptid is removed, so it does not appear in the symbol table. --PpHgzJIASOO9qXt6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+5/soACgkQC3+MBN1Mb4huiACdF7HlpOgyzAnrdakDT8oA6pBf dm4Ani55TMERyJl/z0bUtMCMoUbG9gQi =iNkR -----END PGP SIGNATURE----- --PpHgzJIASOO9qXt6--