This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: add-symbol-file-from-memory patch breaks non-elf targets?
- From: Roland McGrath <roland at redhat dot com>
- To: Randolph Chung <randolph at tausq dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 21 Apr 2004 00:09:05 -0700
- Subject: Re: add-symbol-file-from-memory patch breaks non-elf targets?
When this was all discussed originally (deciding the bfd interface), people
didn't seem concerned about non-ELF targets and seemed to prefer avoiding a
adding a bfd target function rather than just an ELF-specific interface.
Unless bfd maintainers change their minds, that's what we have for the bfd
interface--so callers of it are inherently ELF-specific.
In gdb, I could not find, and still cannot find, a reasonable way to
conditionalize something at compile time on "will there be ELF". Hence the
runtime check for bfd_target_elf_flavour, and the unconditional link-time
reference to bfd_elf_bfd_from_remote_memory. AFAICT, elfread.c is always
built into gdb even for non-ELF targets, as a further example telling me
there really is no good way to conditionalize this correctly. It happens
not to use any bfd_elf_* interfaces and so links ok and is just dead code
in ELFless configurations.
I am open to suggestions.
Thanks,
Roland