zero size set_pcpu linker sets

Bjoern A. Zeeb bzeeb-lists at lists.zabbadoz.net
Fri Nov 27 08:55:09 UTC 2009


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.


More information about the freebsd-hackers mailing list