1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<!-- This file documents the GNU Assembler "as". 4 5Copyright (C) 1991-2021 Free Software Foundation, Inc. 6 7Permission is granted to copy, distribute and/or modify this document 8under the terms of the GNU Free Documentation License, Version 1.3 9or any later version published by the Free Software Foundation; 10with no Invariant Sections, with no Front-Cover Texts, and with no 11Back-Cover Texts. A copy of the license is included in the 12section entitled "GNU Free Documentation License". 13 --> 14<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ --> 15<head> 16<title>Using as: Stab</title> 17 18<meta name="description" content="Using as: Stab"> 19<meta name="keywords" content="Using as: Stab"> 20<meta name="resource-type" content="document"> 21<meta name="distribution" content="global"> 22<meta name="Generator" content="makeinfo"> 23<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 24<link href="index.html#Top" rel="start" title="Top"> 25<link href="AS-Index.html#AS-Index" rel="index" title="AS Index"> 26<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> 27<link href="Pseudo-Ops.html#Pseudo-Ops" rel="up" title="Pseudo Ops"> 28<link href="String.html#String" rel="next" title="String"> 29<link href="Space.html#Space" rel="previous" title="Space"> 30<style type="text/css"> 31<!-- 32a.summary-letter {text-decoration: none} 33blockquote.smallquotation {font-size: smaller} 34div.display {margin-left: 3.2em} 35div.example {margin-left: 3.2em} 36div.indentedblock {margin-left: 3.2em} 37div.lisp {margin-left: 3.2em} 38div.smalldisplay {margin-left: 3.2em} 39div.smallexample {margin-left: 3.2em} 40div.smallindentedblock {margin-left: 3.2em; font-size: smaller} 41div.smalllisp {margin-left: 3.2em} 42kbd {font-style:oblique} 43pre.display {font-family: inherit} 44pre.format {font-family: inherit} 45pre.menu-comment {font-family: serif} 46pre.menu-preformatted {font-family: serif} 47pre.smalldisplay {font-family: inherit; font-size: smaller} 48pre.smallexample {font-size: smaller} 49pre.smallformat {font-family: inherit; font-size: smaller} 50pre.smalllisp {font-size: smaller} 51span.nocodebreak {white-space:nowrap} 52span.nolinebreak {white-space:nowrap} 53span.roman {font-family:serif; font-weight:normal} 54span.sansserif {font-family:sans-serif; font-weight:normal} 55ul.no-bullet {list-style: none} 56--> 57</style> 58 59 60</head> 61 62<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> 63<a name="Stab"></a> 64<div class="header"> 65<p> 66Next: <a href="String.html#String" accesskey="n" rel="next">String</a>, Previous: <a href="Space.html#Space" accesskey="p" rel="previous">Space</a>, Up: <a href="Pseudo-Ops.html#Pseudo-Ops" accesskey="u" rel="up">Pseudo Ops</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p> 67</div> 68<hr> 69<a name="g_t_002estabd_002c-_002estabn_002c-_002estabs"></a> 70<h3 class="section">7.92 <code>.stabd, .stabn, .stabs</code></h3> 71 72<a name="index-symbolic-debuggers_002c-information-for"></a> 73<a name="index-stabx-directives"></a> 74<p>There are three directives that begin ‘<samp>.stab</samp>’. 75All emit symbols (see <a href="Symbols.html#Symbols">Symbols</a>), for use by symbolic debuggers. 76The symbols are not entered in the <code>as</code> hash table: they 77cannot be referenced elsewhere in the source file. 78Up to five fields are required: 79</p> 80<dl compact="compact"> 81<dt><var>string</var></dt> 82<dd><p>This is the symbol’s name. It may contain any character except 83‘<samp>\000</samp>’, so is more general than ordinary symbol names. Some 84debuggers used to code arbitrarily complex structures into symbol names 85using this field. 86</p> 87</dd> 88<dt><var>type</var></dt> 89<dd><p>An absolute expression. The symbol’s type is set to the low 8 bits of 90this expression. Any bit pattern is permitted, but <code>ld</code> 91and debuggers choke on silly bit patterns. 92</p> 93</dd> 94<dt><var>other</var></dt> 95<dd><p>An absolute expression. The symbol’s “other” attribute is set to the 96low 8 bits of this expression. 97</p> 98</dd> 99<dt><var>desc</var></dt> 100<dd><p>An absolute expression. The symbol’s descriptor is set to the low 16 101bits of this expression. 102</p> 103</dd> 104<dt><var>value</var></dt> 105<dd><p>An absolute expression which becomes the symbol’s value. 106</p></dd> 107</dl> 108 109<p>If a warning is detected while reading a <code>.stabd</code>, <code>.stabn</code>, 110or <code>.stabs</code> statement, the symbol has probably already been created; 111you get a half-formed symbol in your object file. This is 112compatible with earlier assemblers! 113</p> 114<dl compact="compact"> 115<dd><a name="index-stabd-directive"></a> 116</dd> 117<dt><code>.stabd <var>type</var> , <var>other</var> , <var>desc</var></code></dt> 118<dd> 119<p>The “name” of the symbol generated is not even an empty string. 120It is a null pointer, for compatibility. Older assemblers used a 121null pointer so they didn’t waste space in object files with empty 122strings. 123</p> 124<p>The symbol’s value is set to the location counter, 125relocatably. When your program is linked, the value of this symbol 126is the address of the location counter when the <code>.stabd</code> was 127assembled. 128</p> 129<a name="index-stabn-directive"></a> 130</dd> 131<dt><code>.stabn <var>type</var> , <var>other</var> , <var>desc</var> , <var>value</var></code></dt> 132<dd><p>The name of the symbol is set to the empty string <code>""</code>. 133</p> 134<a name="index-stabs-directive"></a> 135</dd> 136<dt><code>.stabs <var>string</var> , <var>type</var> , <var>other</var> , <var>desc</var> , <var>value</var></code></dt> 137<dd><p>All five fields are specified. 138</p></dd> 139</dl> 140 141<hr> 142<div class="header"> 143<p> 144Next: <a href="String.html#String" accesskey="n" rel="next">String</a>, Previous: <a href="Space.html#Space" accesskey="p" rel="previous">Space</a>, Up: <a href="Pseudo-Ops.html#Pseudo-Ops" accesskey="u" rel="up">Pseudo Ops</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p> 145</div> 146 147 148 149</body> 150</html> 151