This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix ELF stale reference [Re: [patch] .gdb_index: Do not crash on NOBITS]
On Thu, 09 Sep 2010 16:51:51 +0200, Doug Evans wrote:
> On Thu, Sep 9, 2010 at 2:05 AM, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> > --- a/gdb/elfread.c
> > +++ b/gdb/elfread.c
> > @@ -37,6 +37,7 @@
> > +#include "libbfd.h"
>
> Apologies for nitpicking but this raises an issue I'd like to understand better.
> I thought libbfd.h was an internal bfd header.
> [I know I've wanted to use it at least once and been told "No." :-)]
I have seen
amd64-darwin-tdep.c:#include "libbfd.h"
i386-darwin-tdep.c:#include "libbfd.h"
rs6000-nat.c:#include "libbfd.h" /* For bfd_default_set_arch_mach (FIXME) */
rs6000-tdep.c:#include "libbfd.h" /* for bfd_default_set_arch_mach */
so I considered it legal.
OTOH this patch is not completely clean, it can needlessly allocate
bfd-associated memory and the right fix would probably span into bfd/ IMO.
Thanks,
Jan