This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: Appropriate place to add a check against linking object file formats of a given flavour


   Date: Thu, 20 Apr 2000 17:37:15 -0400
   From: Michael Meissner <meissner@redhat.com>

   I'm trying to fixup the alpha-gnulinux linker so that it gives a
   reasonable error message when the user is attempting to link ELF
   objects with ECOFF (as compared to the core dump that you now get due
   to the elf tdata field being incorrect).  I find I'm flailing around
   trying to patch the leak.  The bfd_arch_get_compatible function seems
   to be a reaonable place, but I find most of the bfd structure has not
   been set up when it is called (xvec in particular).  I also tried
   putting the error in bfd_merge_private_data, but ldlang ignores all
   bfd errors at that point.  So any thoughts of the proper place to put
   this check, or even better, points to code that already does it.

The linker is supposed to cleanly handle linking different object file
formats together.  Whatever code is causing the core dump should not
be examining the elf_tdata field unless it knows it is looking at an
ELF file.  What code is it?

I'm not sure why you say that ldlang ignores BFD errors from
bfd_merge_private_data.  I think it only does so if the
--no-warn-mismatch option is used.  I think that if you want an
intelligent warning about linking ELF and ECOFF files together, that
is a good place for it.

Ian

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