Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Nov 2009 08:51:41 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        Navdeep Parhar <nparhar@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: zero size set_pcpu linker sets
Message-ID:  <20091127084843.V37440@maildrop.int.zabbadoz.net>
In-Reply-To: <d04e16b70911241029q41fb4f8au12574763d9a8eb99@mail.gmail.com>
References:  <d04e16b70911241029q41fb4f8au12574763d9a8eb99@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091127084843.V37440>