This is the mail archive of the
mailing list for the binutils project.
bfd_mmap for archive members
- From: Tristan Gingold <gingold at adacore dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Wed, 18 Nov 2009 15:45:29 +0100
- Subject: bfd_mmap for archive members
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.