Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: torek@elf.bsdi.com (Chris Torek)
Subject: Re: Intel going to 0.18 micron in Q2/99?
Date: 1999/02/28	[thread overview]
Message-ID: <7bcv1f$sdm@elf.bsdi.com> (raw)
In-Reply-To: 7a4f1i$gi$1@andros.cygnus.com

>In article <918917503.41564@haldjas.folklore.ee> Sander Vesik <sander@haldjas.folklore.ee> writes:
>>No, I mean small petty details like the bitness of certain data types
>>like off_t.
>>Are these ABI or API? 

(To which the only possible answer is "yes", "no", or "it depends". :-) )

In article <7a4f1i$gi$1@andros.cygnus.com> TTK Ciar <ttk@cygnus.com> wrote:
>  The ABI (ELF, aout, coff, etc) defines data type sizes.  Usually
>just the primitive ones (byte, short, word, dword), and API defines
>data types in terms of these primitive types (off_t as word, etc). ...

It took me a couple of readings to understand what ttk meant here.

ELF and aout do not define data type sizes for anything other than
the headers and section sizes and such.  In the case of traditional
a.out headers, you may not even get names that correspond to types
for the various fields -- that is, for an a.out header, you have a
"struct exec" with members "a_magic", "a_text", "a_data", "a_bss",
"a_syms", "a_entry", "a_trsize", and "a_drsize" fields.  There may
or may not be some additional fields (such as the "a_dynamic",
"a_toolversion", and "a_mid" in SunOS).  The types of these members
are not well-defined anywhere (sometimes they are "int", sometimes
they are "long", some of them may be bitfields, etc.).  a.out relocation
records are magically different for different machines, and the
interpretation (and even the placement) of the "magic number" that
identifies something as an a.out image is pretty haphazard.

ELF is a lot saner; there is an Elf32_Ehdr for "32-bit ELF" objects
(where "objects" approx= files), and an "Elf64_Ehdr" for 64-bit
objects.  Both of these start with an array of 16 "unsigned char"s
that make up an ELF-object identifier.  The first four invariably
contain 0x7f, 0x45, 0x4c, 0x46 (which spells "\177ELF" in ASCII)
and the next few tell you what kind of ELF object you have, and
what machine it is for, and so on.  (There is room for expansion;
about half of these 16 bytes are undefined as yet.)

>In ELF's case, it has a "size" attribute in the header for 32-bit
>and 64-bit formats, and the sizes of these primitive types depends
>on this attribute ...

(I assume this refers to the EI_CLASS field: either ELFCLASS32 =>
the header is an Elf32_Ehdr, or ELFCLASS64 => the header is an
Elf64_Ehdr.)

In any case, the two header classes use types named, e.g.:

	Elf32_Addr	/* program address (32 bits) */
	Elf32_Half	/* 16-bit field */
	Elf32_Off	/* file offset (32 bits) */

	Elf64_Addr	/* program address (64 bits) */
	Elf64_Sxword	/* 64-bit signed integer */
	Elf64_Xword	/* 64-bit field (not signed) */

These types are used throughout the primary ELF header and then
again for "section" headers, symbol table entries, and relocation
items.

These are *not* general ABI types, however.  These are merely
names for the types that make up the ELF object itself.  Indeed,
the ABI (if any) is more or less independent of the ELF object.
The ABI needs to define how any given bit of code (such as a
main program or subroutine) will call any other bit of code
(another subroutine or function).  This in turn requires not only
pinning down the types (and endian-ness) of such calls, but also
things like "which register(s) hold which parameters and which
return values" and "if the callee is a C varargs/stdarg function,
does it get called in the same way as if it is a C fixed-argument
function or Pascal function or Fortran function", etc.

I have not dealt much with APIs, but assuming this means "how
library and OS data are represented in a source language", these
are essentially independent of ABIs.  They connect at the "output
of a compiler" level, and there is no guarantee that using the
correct source-code constructs will get you correct binary constructs,
nor that using "wrong" source code constructs will get wrong binary
interfaces.  The degree to which one is tied to the other is up to
the compiler:  Whether the "st_size" field of a "stat" structure
is 32- or 64-bits is sometimes an API question, and sometimes an
ABI question.

In our system (BSD/OS 4.0), we use ELF "notes" to "brand" object
files as being "BSD/OS objects".  Objects meant for other systems
(such as Linux) can be caught at this point, and have different
runtime (dynamic-linker) libraries inserted.  (This is how our
forthcoming LAP stuff works.  For the marketing angle, which is
pretty thin on details, see <http://www.bsdi.com/press/19981214>.)

>  There's no good technical reason I can see for not defining the
>more complex types in the ABI ...

I assume this refers to examples like "st_size in `struct stat'".
The problem that occurs when one defines this in an ABI is that
one discovers that the definition came from someone who is still
stuck in the 32-bit-file-size world, and suddenly you cannot deal
with your existing 12GB data files.  Thus, as ttk suggests, this
is more a political issue than a technical one.
-- 
In-Real-Life: Chris Torek, Berkeley Software Design Inc
El Cerrito, CA	Domain:	torek@bsdi.com	+1 510 234 3167
http://claw.bsdi.com/torek/  (not always up)	I report spam to abuse@.



  parent reply	other threads:[~1999-02-28  5:00 UTC|newest]

Thread overview: 129+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <36BAC1F5.9BFAFA51@strategypartners.com>
     [not found] ` <79fi4s$609$1@msunews.cl.msu.edu>
     [not found]   ` <36BB5FEC.E4F308C6@strategypartners.com>
1999-02-06  5:00     ` Intel going to 0.18 micron in Q2/99? Terry C. Shannon
1999-02-06  5:00       ` TTK Ciar
1999-02-06  5:00         ` Terry C. Shannon
1999-02-06  5:00           ` Zalman Stern
1999-02-06  5:00             ` Terry C. Shannon
1999-02-06  5:00           ` TTK Ciar
1999-02-06  5:00         ` Stephen Maudsley
1999-02-06  5:00       ` Daytripper
1999-02-08  5:00         ` Rob Young
1999-02-08  5:00           ` Rob Rodgers
1999-02-08  5:00             ` Zalman Stern
1999-02-08  5:00             ` Rob Young
1999-02-08  5:00               ` Henrik Klagges
1999-02-09  5:00                 ` John  Bayko
1999-02-08  5:00               ` Rob Rodgers
1999-02-08  5:00                 ` Jeffrey J. Potoff
1999-02-09  5:00                   ` Rob Rodgers
1999-02-08  5:00                     ` Jeffrey J. Potoff
1999-02-09  5:00                 ` Peter da Silva
1999-02-09  5:00                   ` Leon Muratov
1999-02-09  5:00                     ` Dave Cherkus
1999-02-10  5:00                       ` Ketil Z Malde
1999-02-10  5:00                         ` Terry Murphy
1999-02-11  5:00                           ` Maynard Handley
1999-02-12  5:00                             ` Sander Vesik
1999-02-12  5:00                               ` Maynard Handley
1999-02-13  5:00                                 ` Sander Vesik
1999-02-13  5:00                                   ` TTK Ciar
1999-02-13  5:00                                     ` JohnC
1999-02-13  5:00                                       ` TTK Ciar
1999-02-13  5:00                                         ` Alex Rosenberg
1999-02-28  5:00                                     ` Chris Torek [this message]
1999-02-13  5:00                                 ` Zalman Stern
1999-02-12  5:00                             ` Casper H.S. Dik - Network Security Engineer
1999-02-12  5:00                             ` Chris
1999-02-12  5:00                               ` Peter da Silva
1999-02-12  5:00                               ` Larry Kilgallen
1999-02-12  5:00                               ` Bruce Hoult
1999-02-12  5:00                               ` Pete Zaitcev
1999-02-12  5:00                                 ` cquirke
1999-02-13  5:00                             ` Zalman Stern
     [not found]                               ` <36c5978f.4874036@news.mv.net>
1999-02-14  5:00                                 ` Zalman Stern
1999-02-14  5:00                                 ` Jon Hart
     [not found]                             ` <9 <casper.918824924@nl-usenet.sun.com>
1999-02-13  5:00                               ` Zalman Stern
1999-02-13  5:00                                 ` Serguei Patchkovskii
1999-02-13  5:00                                   ` Roger Barnett
1999-02-10  5:00                         ` cquirke
1999-02-10  5:00                           ` Andy Glew
1999-02-10  5:00                             ` TTK Ciar
1999-02-11  5:00                               ` Erik Corry
1999-02-11  5:00                                 ` Larry Kilgallen
1999-02-11  5:00                                   ` Ketil Z Malde
1999-02-11  5:00                                     ` St. Suika Roberts
1999-02-11  5:00                                       ` Jeffrey J. Potoff
1999-02-11  5:00                                         ` St. Suika Roberts
1999-02-12  5:00                                           ` Serguei Patchkovskii
1999-02-12  5:00                                             ` Jeffrey J. Potoff
1999-02-11  5:00                                     ` Jeffrey J. Potoff
1999-02-12  5:00                                       ` Ketil Z Malde
1999-02-12  5:00                                         ` David Hinds
1999-02-12  5:00                                           ` Serguei Patchkovskii
1999-02-14  5:00                                             ` Jan Vorbrueggen
1999-02-14  5:00                                               ` Serguei Patchkovskii
1999-02-15  5:00                                                 ` Chris
1999-02-15  5:00                                                   ` John F Carr
1999-02-15  5:00                                                 ` Jan Vorbrueggen
1999-02-14  5:00                                               ` Michael Meissner
1999-02-15  5:00                                             ` Robert Harley
1999-02-15  5:00                                               ` Jerry Leichter
1999-02-16  5:00                                                 ` Robert Harley
1999-02-16  5:00                                                 ` Paul Repacholi
1999-02-17  5:00                                                   ` Adam Price
1999-02-17  5:00                                                     ` Jeffrey J. Potoff
1999-02-15  5:00                                               ` Robert Harley
1999-02-16  5:00                                               ` Amy J. Gleklen
1999-02-12  5:00                                     ` Larry Kilgallen
1999-02-12  5:00                                       ` Ketil Z Malde
1999-02-12  5:00                                         ` Terry C. Shannon
1999-02-11  5:00                                 ` Ketil Z Malde
1999-02-11  5:00                                   ` Erik Corry
1999-02-10  5:00                           ` Thomas Womack
1999-02-11  5:00                             ` Ketil Z Malde
1999-02-11  5:00                           ` Bernd Paysan
1999-02-11  5:00                         ` Carlie Coats
1999-02-11  5:00                           ` Peter Seebach
1999-02-11  5:00                             ` H.W. Stockman
1999-02-12  5:00                               ` Terry C. Shannon
1999-02-12  5:00                                 ` Erik Corry
1999-02-12  5:00                                 ` Jan Vorbrueggen
1999-02-12  5:00                                   ` Timothy J. Bogart
1999-02-12  5:00                                   ` andrew.harrison@uk.sun.nospam.com
1999-02-12  5:00                                     ` Rob Young
1999-02-12  5:00                                       ` Timothy J. Bogart
1999-02-12  5:00                                       ` Andy Glew
1999-02-12  5:00                                         ` John McCalpin
1999-02-15  5:00                                         ` Achim Gratz
1999-02-15  5:00                                       ` andrew.harrison@uk.sun.nospam.com
1999-02-12  5:00                               ` Jeffrey J. Potoff
1999-02-10  5:00                       ` Bernd Paysan
1999-02-11  5:00                         ` Leon Muratov
1999-02-11  5:00                           ` Toon Moene
1999-02-11  5:00                             ` H.W. Stockman
1999-02-12  5:00                               ` Toon Moene
1999-02-12  5:00                                 ` Przemek Klosowski
1999-02-12  5:00                             ` Terje Mathisen
1999-02-12  5:00                               ` Toon Moene
1999-02-12  5:00                                 ` Terje Mathisen
1999-02-12  5:00                                   ` James Van Buskirk
1999-02-13  5:00                                     ` Terje Mathisen
1999-02-24  5:00                                       ` Paul Hsieh
1999-02-09  5:00                 ` Ketil Z Malde
1999-02-10  5:00                 ` Anders Blicher Petersen
1999-02-16  5:00               ` Jan Vorbrueggen
1999-02-11  5:00           ` Paul Repacholi
1999-02-14  5:00         ` Nack
1999-02-15  5:00 ` Dave Cherkus
1999-02-15  5:00   ` Zalman Stern
1999-02-16  5:00     ` Toon Moene
1999-02-16  5:00       ` Zalman Stern
1999-02-16  5:00         ` Toon Moene
1999-02-12  5:00 M Sweger
1999-02-12  5:00 ` Christian Bau
1999-02-12  5:00 ` Jan Vorbrueggen
1999-02-16  5:00   ` Donald Dossa
1999-02-12  5:00 ` TTK Ciar
1999-02-13  5:00 ` Bruce Hoult
1999-02-13  5:00   ` Zalman Stern
  -- strict thread matches above, loose matches on Subject: below --
1999-02-12  5:00 M Sweger
1999-02-12  5:00 ` Jan Vorbrueggen
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox