This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: VMA section overlap warnings for overlays


Alan Modra <amodra@gmail.com> writes:

> On Fri, Jul 16, 2010 at 09:39:16AM +0200, Andreas Schwab wrote:
>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>> 
>> > Why does an empty section affect section layout?
>> 
>> ??? That's the bug.
>
> I think we could probably remove all the sh_size != 0 tests associated
> with ELF_SECTION_IN_SEGMENT in elf.c.  I'm not sure why they were
> there in the first place, possibly to cover bugs in the precursors to
> ELF_SECTION_IN_SEGMENT.

ELF_SECTION_SIZE is also weird.  It returns 0 for a .tbss section
outside a TLS segment, but that makes it impossible to distinguish it
from a genuine empty section.  There are two uses of ELF_SECTION_SIZE
together with ELF_SECTION_IN_SEGMENT, which are in readelf.c end
elf32-spu.c.  Thus readelf -l never considers an empty section be part
of any segment, but removing the ELF_SECTION_SIZE check causes the .tbss
section to be mishandled.  I think ELF_SECTION_IN_SEGMENT_1 should be
modified to handle the special case of .tbss directly.

Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]