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: Jim Blandy <jimb at redhat dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: Randolph Chung <randolph at tausq dot org>, Joel Brobecker <brobecker at gnat dot com>, gdb at sources dot redhat dot com
- Date: 22 Apr 2004 03:04:03 -0500
- Subject: Re: add-symbol-file-from-memory patch breaks non-elf targets?
- References: <200404210709.i3L795Cx002971@magilla.sf.frob.com>
Roland McGrath <roland@redhat.com> writes:
> 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.
I remember this coming up now; I wish I had remembered it before I
approved the patch.
I messed around with it, and I couldn't find a good place either. How
about creating a new file, elf-tdep.c, putting the code there, and
having linux.mt add elf-tdep.o to the link?