Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2010 00:38:49 +0300
From:      Andriy Gapon <avg@freebsd.org>
To:        Jeff Roberson <jroberson@jroberson.net>
Cc:        Peter Wemm <peter@freebsd.org>, freebsd-hackers@freebsd.org, Jeff Roberson <jeff@freebsd.org>, Konstantin Belousov <kib@freebsd.org>, "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
Subject:   Re: elf obj load: skip zero-sized sections early
Message-ID:  <4C3A39E9.1070505@freebsd.org>
In-Reply-To: <alpine.BSF.2.00.1007111112490.1414@desktop>
References:  <4C246CD0.3020606@freebsd.org> <20100702082754.S14969@maildrop.int.zabbadoz.net> <4C320E6E.4040007@freebsd.org> <20100705171155.K14969@maildrop.int.zabbadoz.net> <4C321409.2070500@freebsd.org> <4C343C68.8010302@freebsd.org> <4C36FB32.30901@freebsd.org> <4C39B0E6.3090400@freebsd.org> <4C39B7DE.3030100@freebsd.org> <alpine.BSF.2.00.1007111112490.1414@desktop>

next in thread | previous in thread | raw e-mail | index | archive | help
on 12/07/2010 00:15 Jeff Roberson said the following:
> 
> On Sun, 11 Jul 2010, Andriy Gapon wrote:
> 
>>
>> [oops, sorry, this is not a dup - corrected some omissions/mistakes]
>>
>> on 11/07/2010 14:54 Andriy Gapon said the following:
>>> For completeness, here is a patch that simply drops the inline
>>> assembly and the
>>> comment about it, and GCC-generated assembly and its diff:
>>> http://people.freebsd.org/~avg/dpcpu/pcpu.new.patch
>>> http://people.freebsd.org/~avg/dpcpu/dpcpu.new.s
>>> http://people.freebsd.org/~avg/dpcpu/dpcpu.new.diff
>>>
>>> As was speculated above, the only thing really changed is section
>>> alignment
>>> (from 128 to 4).
>>
>> After making the above analysis I wondered why we require set_pcpu
>> section
>> alignment at all.  After all, it's not used as loaded, data from the
>> section
>> gets copied into special per-cpu memory areas.  So, logically, it's
>> those areas
>> that need to be aligned, not the section.
> 
> I appreciate your analysis but I don't understand the motivation for
> changing working code.

Primary reason is that the "working code" produces zero-sized unused/unnecessary
pcpu_set sections.  See the subject line.  As to why I care about those sections
- please see the start of this thread.

P.S.
Short summary:  there is no reason to have zero sized sections; some tools
either do not expect them or handle them suboptimally.

-- 
Andriy Gapon



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