VMA section overlap warnings for overlays

H.J. Lu hjl.tools@gmail.com
Sat Aug 28 17:25:00 GMT 2010


On Sat, Aug 28, 2010 at 6:28 AM, Alan Modra <amodra@gmail.com> wrote:
> The real bug was that copy_elf_program_header calculated header_size
> from the first section found to be in the segment rather than the
> section with the lowest lma.  So a one line fix.  The rest of this
> patch is to cope with (and fix) invalid program header p_paddr values.

There is no such a thing as "invalid program header p_paddr values"
since ELF spec says it has unspecified contents. You can't depend
on contents in p_addr in objcopy.

> I won't commit this immediately as I'd like to run some more tests.
>
>        PR binutils/11953
>        * elf.c (copy_elf_program_header): Calculate map->header_size
>        from lowest_section, not first_section.  Validate program
>        header p_paddr against section lma.  Find lowest_section in
>        second loop over headers.
>

Can we not look at p_addr here?

-- 
H.J.



More information about the Binutils mailing list