This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: VMA section overlap warnings for overlays
On Mon, Jul 19, 2010 at 02:42:58PM +0200, Andreas Schwab wrote:
> 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.
I think the one in elf32-spu.c can be removed.
> 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.
It will also need changing to properly handle zero size sections at
the end of a segment. Currently, zero size sections may wrongly match
at the end of a segment, or match multiple segments. For instance, if
you just keep the special handling for .tbss in readelf but allow zero
size sections, then a number of powerpc tests fail as follows:
regexp_diff match failure
regexp "^ +03 +\.tdata \.dynamic \.got \.plt $"
line " 03 .tdata .dynamic .branch_lt .got .plt "
regexp_diff match failure
regexp "^ +04 +\.dynamic $"
line " 04 .dynamic .branch_lt "
FAIL: TLSTOC dynamic exec
The first difference is expected; We now include the zero size
.branch_lt in a PT_LOAD header. The second difference is
problematic. .branch_lt doesn't really belong in PT_DYNAMIC.
--
Alan Modra
Australia Development Lab, IBM