<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://gunkies.org/index.php?action=history&amp;feed=atom&amp;title=UNIX_a.out_file</id>
	<title>UNIX a.out file - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://gunkies.org/index.php?action=history&amp;feed=atom&amp;title=UNIX_a.out_file"/>
	<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=UNIX_a.out_file&amp;action=history"/>
	<updated>2026-09-21T09:38:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://gunkies.org/w/index.php?title=UNIX_a.out_file&amp;diff=25489&amp;oldid=prev</id>
		<title>Jnc: /* External links */ forgot a cat</title>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=UNIX_a.out_file&amp;diff=25489&amp;oldid=prev"/>
		<updated>2022-04-06T18:00:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;External links: &lt;/span&gt; forgot a cat&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:00, 6 April 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l96&quot;&gt;Line 96:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 96:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: UNIX]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: UNIX]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: PDP-11 File Formats]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki-wiki_:diff:1.41:old-25487:rev-25489:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Jnc</name></author>
	</entry>
	<entry>
		<id>https://gunkies.org/w/index.php?title=UNIX_a.out_file&amp;diff=25487&amp;oldid=prev</id>
		<title>Jnc: Fairly complete</title>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=UNIX_a.out_file&amp;diff=25487&amp;oldid=prev"/>
		<updated>2022-04-06T17:56:31Z</updated>

		<summary type="html">&lt;p&gt;Fairly complete&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;UNIX a.out files&amp;#039;&amp;#039;&amp;#039; are used to hold [[binary]] [[file]]s of various sorts, both [[relocatable binary]] and also [[object code|executable binary]] files (ready to be loaded into [[main memory]] and run).&lt;br /&gt;
&lt;br /&gt;
They generally hold, in order:&lt;br /&gt;
&lt;br /&gt;
* a header giving overall information about the contents&lt;br /&gt;
* [[object code]]&lt;br /&gt;
* initialized data&lt;br /&gt;
* relocation information&lt;br /&gt;
* a [[symbol table]]&lt;br /&gt;
&lt;br /&gt;
The relocation information is used during [[linking]] of relocatable binary files into an executable binary file; the last two may not exist in finalized executable binary files.&lt;br /&gt;
&lt;br /&gt;
==PDP-11 a.out format==&lt;br /&gt;
&lt;br /&gt;
The format of the a.out header on a [[PDP-11]] (always 8 words long) is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Contents&lt;br /&gt;
|-&lt;br /&gt;
| 0 || A magic number (below)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Program text size&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Initialized data size&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Uninitialized ([[BSS]]) data size&lt;br /&gt;
|-&lt;br /&gt;
| 010 || Symbol table size&lt;br /&gt;
|-&lt;br /&gt;
| 012 || Entry location&lt;br /&gt;
|-&lt;br /&gt;
| 014 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 016 || Flag indicating relocation information has been suppressed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Magic number values are: 0407 (text is not write-protected and not shared), 0410 (text is write-protected, and one copy in [[main memory]] will be shared by all [[process]]es executing that file), or 0411 (as for 0410, but [[instruction]] and data space are separate, with both beginning at 0; i.e. &amp;#039;split I&amp;amp;D&amp;#039;). The origin of the &amp;#039;0407&amp;#039; will be obvious to anyone familiar with PDP-11 object code; in the early days of UNIX, an executable binary file was loaded into memory without stripping off the header, and started at location &amp;#039;0&amp;#039;; the &amp;#039;0407&amp;#039; is a [[jump|BR]] instruction which skips over the header to the first location after it.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;entry location&amp;#039; was always 0 on the PDP-11.&lt;br /&gt;
&lt;br /&gt;
The symbol table consists of an array of 6-word entries. The first four words contain the symbol in [[ASCII]], padded on the end with &amp;#039;0&amp;#039; bytes. The next word is a field indicating the type of symbol (below). The final word is the value (possibly not final in relocatable binary files). Symbol types are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Symbol type&lt;br /&gt;
|- &lt;br /&gt;
| 00 || undefined&lt;br /&gt;
|-&lt;br /&gt;
| 01 || absolute&lt;br /&gt;
|-&lt;br /&gt;
| 02 || text&lt;br /&gt;
|-&lt;br /&gt;
| 03 || data&lt;br /&gt;
|-&lt;br /&gt;
| 04 || BSS&lt;br /&gt;
|-&lt;br /&gt;
| 24 || register assignment&lt;br /&gt;
|-&lt;br /&gt;
| 37 || file name (produced by the linker, &amp;#039;ld&amp;#039;)&lt;br /&gt;
|-&lt;br /&gt;
| 40 || undefined [[external]]&lt;br /&gt;
|-&lt;br /&gt;
| 41 || absolute external&lt;br /&gt;
|-&lt;br /&gt;
| 42 || text external&lt;br /&gt;
|-&lt;br /&gt;
| 43 || data external&lt;br /&gt;
|-&lt;br /&gt;
| 44 || BSS external&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the symbol&amp;#039;s type is un-defined external, and the value field is non-zero, the symbol names a [[common region]], of a size indicated by the value.&lt;br /&gt;
&lt;br /&gt;
If a word in the text or data section involves a reference to an un-defined external symbol (as indicated by the relocation bits for that word - below), the value of the word as stored in the file is an offset from the associated external symbol. When the file is bound into an object file by the [[linker]], the eventual value of the symbol will be added into the word.&lt;br /&gt;
&lt;br /&gt;
If relocation information is present, there is one word per word of text or initialized data. Bits 3-1 of a relocation word indicate the entity referred to by the word associated with the relocation word:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Reference type&lt;br /&gt;
|-&lt;br /&gt;
| 00 || the reference is absolute&lt;br /&gt;
|-&lt;br /&gt;
| 02 || the reference is to the text segment&lt;br /&gt;
|-&lt;br /&gt;
| 04 || the reference is to initialized data&lt;br /&gt;
|-&lt;br /&gt;
| 06 || the reference is to BSS&lt;br /&gt;
|-&lt;br /&gt;
| 10 || the reference is to an un-defined external symbol&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For references to un-defined external symbols, he remaining bits of the relocation word (15-4) contain the index of the symbol&amp;#039;s entry in the table (numbered sequentially from 0).&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
&lt;br /&gt;
* [https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/man/man5/a.out.5 A.OUT - V] - [[UNIX Sixth Edition|UNIX V6]] man page&lt;br /&gt;
&lt;br /&gt;
[[Category: UNIX]]&lt;/div&gt;</summary>
		<author><name>Jnc</name></author>
	</entry>
</feed>