This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

RE: Elf vs Coff




On Wed, 23 Jun 1999, Langerholc, Larry wrote:

> How do you know if a Gnu based compiler is using elf or coff format? For
> instance I build a native compiler for HP-UX and a cross-compiler (that runs
> on HP-UX) for SCO . then there's the compilers that run on Unixware - UDK
> and EGCS Skunkware. Do you know the format for each of those or how to find
> out? Nothing critical, but I'm just curious.

One way is to look for the target name in binutils-XXX/bfd/config.bfd.

Here is a simple script that looks up the canonical name using config.bfd
and prints the output.  It assumes you are in the same directory as
config.bbfd when it is run.

targ=$1
.  ./config.bfd

echo targ_archs=${targ_archs}
echo targ_defvec=${targ_defvec}
echo targ_selvecs=${targ_selvecs}
exit 0

So you get this output:

$ /tmp/j1 hppa1.1-unknown-hpux
targ_archs=bfd_hppa_arch
targ_defvec=som_vec
targ_selvecs=

Which say it is SOM.  i386-unknown-sco yield COFF.

I am on an i686-pc-linux-gnu computer right now and the script reports:

targ_archs=bfd_i386_arch
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386linux_vec
 
so the native format is ELF.

--joel
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985


_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

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