This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: RFA: Recording MIPS ABI selection in binaries


On Tue, Aug 08, 2000 at 06:49:10PM -0700, Chris G. Demetriou wrote:
> And what purpose is there in expressing that a binary uses exactly one
> ISA's/CPU's type of instructions, i.e. why should it be encoded the
> way it is?  Use of an ISA is not exclusive; you can use multiple ISAs
> in a single executable, with (strongly desirable) good effect.

Actually, this brings up a good point: perhaps this ought to be
done per compilation unit rather than for the entire binary.

Looking at the dwarf2 spec (and who cares about others), a likely
candidate is DW_AT_producer.  Then looking at dwarf2out.c, I see

  /* The MIPS/SGI compilers place the 'cc' command line options in the producer
     string.  The SGI debugger looks for -g, -g1, -g2, or -g3; if they do
     not appear in the producer string, the debugger reaches the conclusion
     that the object file is stripped and has no debugging information.
     To get the MIPS/SGI debugger to believe that there is debugging
     information in the object file, we add a -g to the producer string.  */
  if (debug_info_level > DINFO_LEVEL_TERSE)
    strcat (producer, " -g");

So there's precedent for looking into this string to figure out
how the binary may be interpreted.  All we'd need, then, is some
way to dump the relevant options into this string.



r~

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