In VBCC/Vlink generated code, all symbols are relative
to TEXT section start, in everything else I've checked
(e.g. VBCC/Vasm and GCC "-Wl,--traditional-format -g"),
all symbol addresses are relative to their own
(=TEXT/DATA/BSS) section's start.
I assume latter is correct, right?
Is there anywhere documentation on this?
SYMBOL TABLE
------------
The symbol table defines the symbols referenced by a command file. Each
entry in the symbol table is associated with an index that indicates its
entry number. Entries are numbered sequentially starting with zero. As
shown in Figure 3-3, each symbol table entry is composed of seven words
that describe the symbol's name, type, and value.
+--------+--------+
0 | |
+ Symbol +
| |
+ +
| Name |
+ +
6 | |
+--------+--------+
8 | Type |
+--------+--------+
A | |
+ Value +
C | |
+--------+--------+
Figure 3-3. Symbol Table Entry
Table 3-1 describes the fields of a symbol table entry.
Table 3-1. Symbol Table Entry Fields
Field Definition
Name Symbol name, null-padded right if less than eight
characters.
Type Symbol type as indicated by the following values:
0100H: bss-based relocatable
0200H: text-based relocatable
0400H: data-based relocatable
0800H: external reference
1000H: equated register
2000H: global
4000H: equated
8000H: defined
Value Symbol value where the value can be an address, register
number, value of an _expression_, and so forth. Note that the
linkers interpret the value when the symbol is external
(0800H) as the size of a common region.