4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"STABS">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"Symbol%20Table%20Format">Symbol Table Format
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"Transformations-On-Symbol-Tables.html#Transformations%20On%20Symbol%20Tables">Transformations On Symbol Tables
</a>,
14 Up:
<a rel=
"up" accesskey=
"u" href=
"Symbol-Tables.html#Symbol%20Tables">Symbol Tables
</a>
18 <h3 class=
"section">Symbol Table Format
</h3>
20 <p>Each time the assembler encounters a stab directive, it puts
21 each field of the stab into a corresponding field in a symbol table
22 entry of its output file. If the stab contains a string field, the
23 symbol table entry for that stab points to a string table entry
24 containing the string data from the stab. Assembler labels become
25 relocatable addresses. Symbol table entries in a.out have the format:
27 <pre class=
"example"> struct internal_nlist {
28 unsigned long n_strx; /* index into string table of name */
29 unsigned char n_type; /* type of symbol */
30 unsigned char n_other; /* misc info (usually empty) */
31 unsigned short n_desc; /* description field */
32 bfd_vma n_value; /* value of symbol */
36 <p>If the stab has a string, the
<code>n_strx
</code> field holds the offset in
37 bytes of the string within the string table. The string is terminated
38 by a NUL character. If the stab lacks a string (for example, it was
39 produced by a
<code>.stabn
</code> or
<code>.stabd
</code> directive), the
40 <code>n_strx
</code> field is zero.
42 <p>Symbol table entries with
<code>n_type
</code> field values greater than
0x1f
43 originated as stabs generated by the compiler (with one random
44 exception). The other entries were placed in the symbol table of the
45 executable by the assembler or the linker.