From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22547 invoked from network); 29 May 2022 00:58:16 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 29 May 2022 00:58:16 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id E5661421F4; Sun, 29 May 2022 10:58:10 +1000 (AEST) Received: from mail-vs1-xe29.google.com (mail-vs1-xe29.google.com [IPv6:2607:f8b0:4864:20::e29]) by minnie.tuhs.org (Postfix) with ESMTPS id 4D920421E3 for ; Sun, 29 May 2022 10:58:06 +1000 (AEST) Received: by mail-vs1-xe29.google.com with SMTP id c62so7659082vsc.10 for ; Sat, 28 May 2022 17:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N/2WtmTOUhdrydTm7Gnj5FBQr0q5QJ07GW1/p15K/Dk=; b=h1nIs/Eb8nfSTNE5Vzj4kFMi8Ky89atHZfoP5M31f9pRi8n6mEP58jMSu9gk9OMUt2 i4mdoVgzS/OjmzP0VY8mXbuiNVuab/zPtSWFhm69FPf81aa4AzA79vxs4bdySy2b7hdl uDkslzNLHl0DZZ7r2ALmD0LrB5o453Xn91ADHcCzyhgnsocDqej1zO8YOlq919eD7yZz AftbZF97Oc/8HJLAFKB5FzugjKRiD4bxZ3XYDIPKBL3Pku/uOQGWmGENkZ8esx1xBNbu jkAhbefIYA5Rbnz2MzHUMcl9ABRkREv6FxguNuuK5kXeWVX5sFLDtU/v8iHENiXS/kzC WYFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N/2WtmTOUhdrydTm7Gnj5FBQr0q5QJ07GW1/p15K/Dk=; b=Mg9jTgpAeoLOM9IudT4IGhMynCUm8FpvbnLRyVR5pKAl6p/sV7uKPalsGldrTLpGqK MtLd7Qg+UU4SuIIQkyLIois6k1QpB24qWnzoijVomWjT57wf8XOpvG4b4wRWA45yjOlY CsSZfkGhLxYfskZH+oPJ+B0yDziiJ7o4Mag0aa29CM+/lqnzhFJZGoZu4v7sA4WP/O8N QAqv9Qa5FnnREBcUvBKLtmnK3hlSUTCdVT+p/cIrzpQAxSWUMUUrVoWzU/qDj9V3SBaK /bUo2PUMUrU5XlBN/125ozPUaLcgGs2/eabYMiahQ8otUL8inqScHiCOd50o8PyBEC4L czdQ== X-Gm-Message-State: AOAM533n6K9GxYogwc1WJiu9R8FuefZ9BSodALoE13or3j4y5HAwqxIV 4xCnYiUKcLR7cc2AyL5CJJBVpqHaQBRSe7oFGAc3iA== X-Google-Smtp-Source: ABdhPJytxAXYO6hWBqEbvmRlttuqLpACyaIiBbVV61bCNr2t1lZkjnHaxn/9QCC07mUQWmz5bzpT5Q8b2LkMIly2g34= X-Received: by 2002:a05:6102:c0b:b0:339:8566:2028 with SMTP id x11-20020a0561020c0b00b0033985662028mr6118477vss.38.1653785885218; Sat, 28 May 2022 17:58:05 -0700 (PDT) MIME-Version: 1.0 References: <64EEED76-2EBB-4D55-ADE4-DEDFAC391322@planet.nl> <66ae3ff2-bd07-e192-a00f-f9c701d857c8@spamtrap.tnetconsulting.net> In-Reply-To: From: Warner Losh Date: Sat, 28 May 2022 18:57:54 -0600 Message-ID: To: Paul Winalski Content-Type: multipart/alternative; boundary="000000000000392f1e05e01c0865" Message-ID-Hash: NIG5GTWHQVMN7GSGTI3CSANVTWZERF3O X-Message-ID-Hash: NIG5GTWHQVMN7GSGTI3CSANVTWZERF3O X-MailFrom: wlosh@bsdimp.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Grant Taylor , The Eunuchs Hysterical Society X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: Historical application software List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --000000000000392f1e05e01c0865 Content-Type: text/plain; charset="UTF-8" On Sat, May 28, 2022 at 9:30 AM Paul Winalski wrote: > On 5/27/22, Warner Losh wrote: > > > > People working on emulators run into these issues all the time as well. > > There was a greater diversity of object formats when Unix was younger > > as well, most have been displaced by ELF (PECOFF being the only exception > > that's still around outside of Windows). > > The object formats that I'm aware of on Unix are: > > a.out - comes in three flavors: > OMAGIC - executable instructions (text) and static data in the same section > NMAGIC - text separate from data; shared text > ZMAGIC - text separate from data; demand paged bsd 2.11 has 6 different magic numbers. The three extra are one flavor of overlays that does the itself, and two flavor that do it automatically (I've not plumbed the depths of the code to know what that means) with separate I&D and one without. > MACH-O - Object and executable format for the MACH microkernel. This > is still the object format used by the Mac OS X operating system, > which IIRC was built by placing FreeBSD Unix on top of the MACH > microkernel. It allows more than the three sections (.text, .data, > .bss) in a.out. > > COFF - Common Object File Format. Allows up to 64 object fsections. > HP-UX had a weird form of COFF in the early days. IBM AIX had its own thing that wasn't quite COFF, nor was it quite a.out. Apollo also had a variation on COFF that wasn't quite standard. I wrote a symbol mangler for all of these in the early 90s and each one was its own special snowflake. > ELF - Executable and Linkable Format. Much more uniform (everything > is a section) than its predecessors, and allows essentially an > arbitrary number of sections. In addition to its use on Unix, this is > the object file and executable format used by Linux and OpenVMS (on > Itanium and x86). > > Are there others? > > PECOFF, Portable Executable and Common Object File Format, is the > object file and executable format used by Microsoft Windows. It is a > derivative of COFF, but, in typical Microsoft embrace-and-extend > fashion, there are significant differences. When Windows NT was > ported to the DEC Alpha processor, I had to add PECOFF support to > DEC's GEM compiler back end. I started by adding conditional code to > the existing COFF support, but I found that PECOFF differed enough > from vanilla COFF that it was easier and more maintainable to fork off > a separate module for it. > pecoff is also used for UEFI binaries... Though the subset that's used tends to be smaller than what windows itself uses. Warner --000000000000392f1e05e01c0865 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, May 28, 2022 at 9:30 AM Paul = Winalski <paul.winalski@gmail= .com> wrote:
On 5/27/22, Warner Losh <imp@bsdimp.com> wrote:
>
> People working on emulators run into these issues all the time as well= .
> There was a greater diversity of object formats when Unix was younger<= br> > as well, most have been displaced by ELF (PECOFF being the only except= ion
> that's still around outside of Windows).

The object formats that I'm aware of on Unix are:

a.out - comes in three flavors:
OMAGIC - executable instructions (text) and static data in the same section=
NMAGIC - text separate from data; shared text
ZMAGIC - text separate from data; demand paged
=C2=A0
bsd 2.11 has 6 different=C2=A0magic numbers. The three=C2=A0extra are= one flavor of overlays that does the itself, and two flavor that do it aut= omatically (I've not plumbed the depths of the code to know what that m= eans) with separate I&D and one without.
=C2=A0
MACH-O - Object and executable format for the MACH microkernel.=C2=A0 This<= br> is still the object format used by the Mac OS X operating system,
which IIRC was built by placing FreeBSD Unix on top of the MACH
microkernel.=C2=A0 It allows more than the three sections (.text, .data, .bss) in a.out.

COFF - Common Object File Format.=C2=A0 Allows up to 64 object fsections.

HP-UX had a weird form of COFF in the ea= rly days. IBM AIX had its own thing that wasn't quite COFF, nor was it = quite a.out. Apollo also had a variation on COFF that wasn't quite stan= dard. I wrote a symbol mangler for all of these in the early 90s and each o= ne was its own special snowflake.
=C2=A0
ELF - Executable and Linkable Format.=C2=A0 Much more uniform (everything is a section) than its predecessors, and allows essentially an
arbitrary number of sections.=C2=A0 In addition to its use on Unix, this is=
the object file and executable format used by Linux and OpenVMS (on
Itanium and x86).

Are there others?

PECOFF, Portable Executable and Common Object File Format, is the
object file and executable format used by Microsoft Windows.=C2=A0 It is a<= br> derivative of COFF, but, in typical Microsoft embrace-and-extend
fashion, there are significant differences.=C2=A0 When Windows NT was
ported to the DEC Alpha processor, I had to add PECOFF support to
DEC's GEM compiler back end.=C2=A0 I started by adding conditional code= to
the existing COFF support, but I found that PECOFF differed enough
from vanilla COFF that it was easier and more maintainable to fork off
a separate module for it.

pecoff is als= o used for UEFI binaries... Though the subset that's used tends
to be smaller than what windows itself uses.=C2=A0

<= div>Warner
--000000000000392f1e05e01c0865--