From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 27 08:55:09 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42A0E1065679 for ; Fri, 27 Nov 2009 08:55:09 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id CCE668FC15 for ; Fri, 27 Nov 2009 08:55:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 04AB941C796; Fri, 27 Nov 2009 09:55:07 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id Bi2LEcLw412U; Fri, 27 Nov 2009 09:55:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 2D0BB41C795; Fri, 27 Nov 2009 09:55:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 4CB754448EC; Fri, 27 Nov 2009 08:51:41 +0000 (UTC) Date: Fri, 27 Nov 2009 08:51:41 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Navdeep Parhar In-Reply-To: Message-ID: <20091127084843.V37440@maildrop.int.zabbadoz.net> References: X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: zero size set_pcpu linker sets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 08:55:09 -0000 On Tue, 24 Nov 2009, Navdeep Parhar wrote: Hi, > objdump -h shows that most, but not all, KLDs on amd64 have a "set_pcpu" > section of size 0. Why? What is the difference between having a 0 > sized set_pcpu vs. not having it at all? > > The kernel linker considers the alignment requirements of these empty > sections and advances mapsize/mapbase. This bothers my kgdb (which is > slightly modified to deal with amd64 KLDs). So what's your real problem? > I'm using the patch shown here as a stopgap measure. I think the correct > fix is to not have these empty sections in the KLD to begin with. Right. The problem here is a bug with ld and linker sets and size and aligment calculations the the elf section is started when not all of this is known correctly and it's not fixed later. This came up with that "netisr" bug where we had seen the misalignment of the dpcpu set. /bz -- Bjoern A. Zeeb It will not break if you know what you are doing.