elf obj load: skip zero-sized sections early

Andriy Gapon avg at freebsd.org
Sun Jul 11 21:38:56 UTC 2010


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


More information about the freebsd-hackers mailing list