[patch] bfd: Core files with p_filesz < p_memsz (build-id)

Daniel Jacobowitz drow@false.org
Fri Aug 3 00:21:00 GMT 2007


On Fri, Aug 03, 2007 at 09:43:00AM +0930, Alan Modra wrote:
> Oh, I see.  I was just looking at the split case.  I'd say the
> non-split behaviour is a bug.  A program header with p_filesz zero and
> p_memsz non-zero really ought to create a bfd section with size equal
> to p_memsz, without SEC_HAS_CONTENTS and SEC_LOAD.
> 
> So I think we should apply the following, and possibly on top of this
> do something special for core files.

Yes, I agree.  But keep in mind that this patch on its own is going to
lay waste to GDB's core debugging :-)  It will now disassemble all
functions as zeroes.

What we really want in GDB is now a bit complicated:
  - Prefer data from core file if within p_filesz.
  - Prefer data from executable if between p_filesz and p_memsz.
  - Show zeroes (rather than read errors) for data between p_filesz
    and p_memsz if not present in the executable.

Messy...

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Binutils mailing list