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


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.


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