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=
"Stab%20Section%20Transformations">Stab Section Transformations
</a>,
13 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Transformations-On-Global-Variables.html#Transformations%20On%20Global%20Variables">Transformations On Global Variables
</a>,
14 Up:
<a rel=
"up" accesskey=
"u" href=
"Transformations-On-Symbol-Tables.html#Transformations%20On%20Symbol%20Tables">Transformations On Symbol Tables
</a>
18 <h4 class=
"subsection">Transformations of Stabs in separate sections
</h4>
20 <p>For object file formats using stabs in separate sections (see
<a href=
"Stab-Sections.html#Stab%20Sections">Stab Sections
</a>), use
<code>objdump --stabs
</code> instead of
<code>nm
</code> to show the
21 stabs in an object or executable file.
<code>objdump
</code> is a GNU utility;
22 Sun does not provide any equivalent.
24 <p>The following example is for a stab whose value is an address is
25 relative to the compilation unit (see
<a href=
"ELF-Linker-Relocation.html#ELF%20Linker%20Relocation">ELF Linker Relocation
</a>). For
26 example, if the source line
28 <pre class=
"example"> static int ld =
5;
31 <p>appears within a function, then the assembly language output from the
34 <pre class=
"example"> .Ddata.data:
36 .stabs
"ld:V(0,3)",
0x26,
0,
4,.L18-Ddata.data #
0x26 is N_STSYM
43 <p>Because the value is formed by subtracting one symbol from another, the
44 value is absolute, not relocatable, and so the object file contains
46 <pre class=
"example"> Symnum n_type n_othr n_desc n_value n_strx String
47 31 STSYM
0 4 00000004 680 ld:V(
0,
3)
50 <p>without any relocations, and the executable file also contains
52 <pre class=
"example"> Symnum n_type n_othr n_desc n_value n_strx String
53 31 STSYM
0 4 00000004 680 ld:V(
0,
3)