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: [patch] bfd: Core files with p_filesz < p_memsz (build-id)


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


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