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]

bfd_mmap for archive members


Hi,

currently bfd_mmap does nothing particular with archive members, ie it doesn't add the member offset in the
archive to the offset argument.  This is not the behaviour of bfd_seek (which handles archive members).

I today hit this issue because gdb/dwarf2read.c uses bfd_mmap to read dwarf and because Darwin has fat
binaries, the bfd may be a archive member.

I don't think that we can fix bfd_mmap because gdb/dwarf2read.c does address arithmetic with the offset to
align it to a page.  Adding member offset would invalidate this calculation.  Maybe the interface of bfd_mmap
was not designed for member but I suppose it is too late to change it.

I plan to post a path on gdb-patches to fix this issue but I'd like to have a confirmation that this is
the right way to do it.  If so I also plan to improve the documentation for bfd_mmap to make the handling
of archive members clearer.

Tristan.


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