A symbol
The symbol table sits between the data and the relocation table; the header gives its length. It is a debugger’s help and most released programs have none (the header size is 0). In the Digital Research (DRI) format every entry is 14 bytes:
| Offset | Size | Field |
|---|---|---|
| 0 | 8 bytes | The name; a shorter name is ended by a 0 byte. |
| 8 | word | The type: a set of flag bits (below). |
| 10 | long | The value, an address. Producers differ: vasm (vasmm68k_mot -Ftos) writes the offset inside the symbol’s own segment by default (a label 12 bytes into the data is 12) and text-based values only with -monst (the same label is the text size plus 12). The two files were built and read in test-atari-vasm.mjs. The file does not say which kind it holds, so the explorer’s Symbol values option offers Auto (the default), offsets from the start of the text and offsets within each segment. Auto takes the reading in which every data symbol lies inside the data and every BSS symbol inside the BSS; if both readings fit, or neither, it assumes text-based values and says so in the Symbols table. This detection is our own heuristic, tested on the two vasm files and built files only. |
Types
| Bit | Meaning |
|---|---|
$0100 | in the BSS |
$0200 | in the text |
$0400 | in the data |
$0800 | external |
$1000 | register |
$2000 | global |
$4000 | equated |
$8000 | defined |
$0280 and $02C0 | the start of an object module and of a library (text plus extra bits) |
Long names
A name longer than 8 characters sets both bits of $0048 in the type, and the next 14-byte entry holds the rest of the name (up to 14 more characters: 22 in all; the GNU linker
truncates longer ones). The explorer joins the two and shows the entry as one symbol 28 bytes long.
What the explorer shows
The symbol table is a node with one child per symbol (the first 1500) and a Symbols table with name, type and value. Each symbol becomes a label at its value (relative to the
load address) in the disassembly, and the program’s start is labelled start when no symbol is there. A table whose size is not a multiple of 14 is reported as a problem:
Pure C and the GNU linker write their own symbol formats.
Not described
Known, not yet covered
- Reference: the types and entry size agree with the raw text of the FreeMiNT TOS documentation and the GNU linker source
prg-mint.c(DRI_SYMBOL_SIZE 14,A_LNAM 0x0048“GST compatible long name”,A_TFILE 0x0280,A_TFARC 0x02C0, read 2026-11-14; the source notes that A_TFARC conflicts with the bits of A_LNAM). The documentation says nothing about the long-name form (taken from the linker source) and which base the value counts from (the start of the text, or its own segment) is producer dependent: the viewer detects it or takes the user’s choice (see the value row above), but only vasm was tried as a real producer; Atari tools (Alcyon, Pure C, Devpac, GNU) were not available, so what each of them writes is unknown here. The Pure C, Alcyon extended and GNU a.out symbol formats are not described. - Viewer: checked on built symbol tables only; no real one.
Links
Reference
- GEMDOS programs – FreeMiNT TOS documentation: the DRI symbol table and the type bits
- prg-mint.c – BFD code: the DRI symbol structure and the long-name bit