Return to BSD News archive
Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.mel.connect.com.au!news.mel.aone.net.au!news.netspace.net.au!news.mira.net.au!news.vbc.net!vbcnet-west!bulb.garlic.com!news.scruz.net!noos.hooked.net!www.nntp.primenet.com!nntp.primenet.com!news.mathworks.com!rill.news.pipex.net!pipex!oleane!jussieu.fr!fdn.fr!r2d2.fdn.org!sphynx.fdn.fr!causse
From: causse@sphynx.fdn.fr (Philippe Causse)
Subject: Re: ELF?
X-Newsreader: TIN [version 1.2 PL2]
Organization: individual - paris - france
Message-ID: <E9Hqu3.2tJ@sphynx.fdn.fr>
References: <cmott-2004971630470001@192.168.0.5> <5k8eve$8j@uriah.heep.sax.de>
Date: Thu, 1 May 1997 07:15:39 GMT
Lines: 60
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:40104
J Wunsch (j@uriah.heep.sax.de) wrote:
: Joel Ray Holveck <joelh@gnu.ai.mit.edu> wrote:
: > I don't design linkage formats, I just link. So, what's the
: > difference between a.out, b.out, ELF, and coff?
: I can't explain any and all differences (and i don't even know b.out),
: but in short:
: a.out:
: Oldest, and `classic' unix object format. Short and compact header,
: with a magic number at the beginning that's often used to characterize
: the format. Three loaded segments: .text, .data, and .bss, plus a
: symbol table and a string table in the file.
: COFF:
: SVR3 object format. The header now comprises a section table, so you
: can have more than just .text, .data, and .bss. IIRC, the section
: length values are 16-bit entities only.
Sorry, but section length values are regular 32-bit longs !
(from /usr/src/sys/i386/ibcs2/coff.h)
struct scnhdr {
char s_name[8]; /* name of section (e.g., ".text") */
long s_paddr; /* physical addr, used for standalone */
long s_vaddr; /* virtual address */
long s_size; /* size of section */
~~~~~~~~~~~~~~~~~~~~~~~~
long s_scnptr; /* file offset of section */
long s_relptr; /* points to relocs for section */
long s_lnnoptr; /* points to line numbers for section */
unsigned short s_nreloc; /* # of relocs */
unsigned short s_nlnno; /* # of line no's */
long s_flags; /* section flags -- see below */
};
BTW, there's an excellent book on COFF from O'Reilly & Associates,
called "Understanding and Using COFF".
I checked the above information in this book: s_size is a long.
: ELF:
: Successor of COFF. Multiple sections, and 32-bit or 64-bit numbers
: possible. Major drawback: ELF has been designed in the assumption
: that there will be only one ABI per architecture. There isn't
: actually, not even in the commercial SysV world (which has at least
: three ABIs: SVR4, Solaris, SCO).
: --
: cheers, J"org
: joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
: Never trust an operating system you don't have sources for. ;-)
--
-------------------------------------------------------------------
P. Causse http://www.fdn.fr/~pcausse
4.4BSD/X11R6/Motif-2.0/C++ mailto:causse@sphynx.fdn.fr (UUCP)