21.html
来自「linux 0.11中文版 有注释」· HTML 代码 · 共 311 行 · 第 1/2 页
HTML
311 行
<a name='L144'><b>struct</b> nlist
<a name='L145'><font color='red'>{</font>
<a name='L146'> <b>union</b>
<a name='L147'> <font color='red'>{</font>
<a name='L148'> <b>char</b> *n_name;
<a name='L149'> <b>struct</b> nlist *n_next;
<a name='L150'> <b>long</b> n_strx;
<a name='L151'> <font color='red'>}</font>
<a name='L152'> n_un;
<a name='L153'> <b>unsigned</b> <b>char</b> n_type;
<a name='L154'> <b>char</b> n_other;
<a name='L155'> <b>short</b> n_desc;
<a name='L156'> <b>unsigned</b> <b>long</b> n_value;
<a name='L157'><font color='red'>}</font>;
<a name='L158'><font color='darkred'>#endif</font>
<a name='L159'>
<a name='L160'><i><font color='green'>// 下面定义exec 结构中的变量偏移值。</font></i>
<a name='L161'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L162' title='Defined at 162 in include/a.out.h.'>N_UNDF</a>
<a name='L162'><font color='darkred'>#define</font> <a href='../S/21.html#L161' title='Refered from 161 in include/a.out.h.'>N_UNDF</a> 0
<a name='L163'><font color='darkred'>#endif</font>
<a name='L164'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L165' title='Defined at 165 in include/a.out.h.'>N_ABS</a>
<a name='L165'><font color='darkred'>#define</font> <a href='../S/21.html#L164' title='Refered from 164 in include/a.out.h.'>N_ABS</a> 2
<a name='L166'><font color='darkred'>#endif</font>
<a name='L167'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L168' title='Defined at 168 in include/a.out.h.'>N_TEXT</a>
<a name='L168'><font color='darkred'>#define</font> <a href='../S/21.html#L167' title='Refered from 167 in include/a.out.h.'>N_TEXT</a> 4
<a name='L169'><font color='darkred'>#endif</font>
<a name='L170'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L171' title='Defined at 171 in include/a.out.h.'>N_DATA</a>
<a name='L171'><font color='darkred'>#define</font> <a href='../S/21.html#L170' title='Refered from 170 in include/a.out.h.'>N_DATA</a> 6
<a name='L172'><font color='darkred'>#endif</font>
<a name='L173'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L174' title='Defined at 174 in include/a.out.h.'>N_BSS</a>
<a name='L174'><font color='darkred'>#define</font> <a href='../S/21.html#L173' title='Refered from 173 in include/a.out.h.'>N_BSS</a> 8
<a name='L175'><font color='darkred'>#endif</font>
<a name='L176'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L177' title='Defined at 177 in include/a.out.h.'>N_COMM</a>
<a name='L177'><font color='darkred'>#define</font> <a href='../S/21.html#L176' title='Refered from 176 in include/a.out.h.'>N_COMM</a> 18
<a name='L178'><font color='darkred'>#endif</font>
<a name='L179'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L180' title='Defined at 180 in include/a.out.h.'>N_FN</a>
<a name='L180'><font color='darkred'>#define</font> <a href='../S/21.html#L179' title='Refered from 179 in include/a.out.h.'>N_FN</a> 15
<a name='L181'><font color='darkred'>#endif</font>
<a name='L182'>
<a name='L183'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L184' title='Defined at 184 in include/a.out.h.'>N_EXT</a>
<a name='L184'><font color='darkred'>#define</font> <a href='../S/21.html#L183' title='Refered from 183 in include/a.out.h.'>N_EXT</a> 1
<a name='L185'><font color='darkred'>#endif</font>
<a name='L186'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L187' title='Defined at 187 in include/a.out.h.'>N_TYPE</a>
<a name='L187'><font color='darkred'>#define</font> <a href='../S/21.html#L186' title='Refered from 186 in include/a.out.h.'>N_TYPE</a> 036
<a name='L188'><font color='darkred'>#endif</font>
<a name='L189'><font color='darkred'>#ifndef</font> <a href='../S/21.html#L190' title='Defined at 190 in include/a.out.h.'>N_STAB</a>
<a name='L190'><font color='darkred'>#define</font> <a href='../S/21.html#L189' title='Refered from 189 in include/a.out.h.'>N_STAB</a> 0340
<a name='L191'><font color='darkred'>#endif</font>
<a name='L192'>
<a name='L193'><i><font color='green'>/* The following type indicates the definition of a symbol as being</font></i>
<a name='L194'><i><font color='green'>an indirect reference to another symbol. The other symbol</font></i>
<a name='L195'><i><font color='green'>appears as an undefined reference, immediately following this symbol.</font></i>
<a name='L196'><i><font color='green'></font></i>
<a name='L197'><i><font color='green'>Indirection is asymmetrical. The other symbol's value will be used</font></i>
<a name='L198'><i><font color='green'>to satisfy requests for the indirect symbol, but not vice versa.</font></i>
<a name='L199'><i><font color='green'>If the other symbol does not have a definition, libraries will</font></i>
<a name='L200'><i><font color='green'>be searched to find a definition. */</font></i>
<a name='L201'><i><font color='green'>/* 下面的类型指明了符号的定义作为对另一个符号的间接引用。紧接该符号的其它</font></i>
<a name='L202'><i><font color='green'>* 的符号呈现为未定义的引用。</font></i>
<a name='L203'><i><font color='green'>*</font></i>
<a name='L204'><i><font color='green'>* 间接性是不对称的。其它符号的值将被用于满足间接符号的请求,但反之不然。</font></i>
<a name='L205'><i><font color='green'>* 如果其它符号并没有定义,则将搜索库来寻找一个定义 */</font></i>
<a name='L206'><font color='darkred'>#define</font> N_INDR 0xa
<a name='L207'>
<a name='L208'><i><font color='green'>/* The following symbols refer to set elements.</font></i>
<a name='L209'><i><font color='green'>All the N_SET[ATDB] symbols with the same name form one set.</font></i>
<a name='L210'><i><font color='green'>Space is allocated for the set in the text section, and each set</font></i>
<a name='L211'><i><font color='green'>element's value is stored into one word of the space.</font></i>
<a name='L212'><i><font color='green'>The first word of the space is the length of the set (number of elements).</font></i>
<a name='L213'><i><font color='green'></font></i>
<a name='L214'><i><font color='green'>The address of the set is made into an N_SETV symbol</font></i>
<a name='L215'><i><font color='green'>whose name is the same as the name of the set.</font></i>
<a name='L216'><i><font color='green'>This symbol acts like a N_DATA global symbol</font></i>
<a name='L217'><i><font color='green'>in that it can satisfy undefined external references. */</font></i>
<a name='L218'><i><font color='green'>/* 下面的符号与集合元素有关。所有具有相同名称N_SET[ATDB]的符号</font></i>
<a name='L219'><i><font color='green'>形成一个集合。在代码部分中已为集合分配了空间,并且每个集合元素</font></i>
<a name='L220'><i><font color='green'>的值存放在一个字(word)的空间。空间的第一个字存有集合的长度(集合元素数目)。</font></i>
<a name='L221'><i><font color='green'>集合的地址被放入一个N_SETV 符号,它的名称与集合同名。</font></i>
<a name='L222'><i><font color='green'>在满足未定义的外部引用方面,该符号的行为象一个N_DATA 全局符号。*/</font></i>
<a name='L223'>
<a name='L224'><i><font color='green'>/* These appear as input to LD, in a .o file. */</font></i>
<a name='L225'><i><font color='green'>/* 以下这些符号在目标文件中是作为链接程序LD 的输入。*/</font></i>
<a name='L226'><font color='darkred'>#define</font> N_SETA 0x14 <i><font color='green'>/* Absolute set element symbol */</font></i>
<a name='L227'><i><font color='green'>/* 绝对集合元素符号 */</font></i>
<a name='L228'><font color='darkred'>#define</font> N_SETT 0x16 <i><font color='green'>/* Text set element symbol */</font></i>
<a name='L229'><i><font color='green'>/* 代码集合元素符号 */</font></i>
<a name='L230'><font color='darkred'>#define</font> N_SETD 0x18 <i><font color='green'>/* Data set element symbol */</font></i>
<a name='L231'><i><font color='green'>/* 数据集合元素符号 */</font></i>
<a name='L232'><font color='darkred'>#define</font> N_SETB 0x1A <i><font color='green'>/* Bss set element symbol */</font></i>
<a name='L233'><i><font color='green'>/* Bss 集合元素符号 */</font></i>
<a name='L234'>
<a name='L235'><i><font color='green'>/* This is output from LD. */</font></i>
<a name='L236'><i><font color='green'>/* 下面是LD 的输出。*/</font></i>
<a name='L237'><font color='darkred'>#define</font> N_SETV 0x1C <i><font color='green'>/* Pointer to set vector in data area. */</font></i>
<a name='L238'><i><font color='green'>/* 指向数据区中集合向量。*/</font></i>
<a name='L239'>
<a name='L240'><font color='darkred'>#ifndef</font> N_RELOCATION_INFO_DECLARED
<a name='L241'>
<a name='L242'><i><font color='green'>/* This structure describes a single relocation to be performed.</font></i>
<a name='L243'><i><font color='green'>The text-relocation section of the file is a vector of these structures,</font></i>
<a name='L244'><i><font color='green'>all of which apply to the text section.</font></i>
<a name='L245'><i><font color='green'>Likewise, the data-relocation section applies to the data section. */</font></i>
<a name='L246'><i><font color='green'>/* 下面的结构描述执行一个重定位的操作。</font></i>
<a name='L247'><i><font color='green'>文件的代码重定位部分是这些结构的一个向量,所有这些适用于代码部分。</font></i>
<a name='L248'><i><font color='green'>类似地,数据重定位部分适用于数据部分。*/</font></i>
<a name='L249'>
<a name='L250'><i><font color='green'>// 重定位信息结构。</font></i>
<a name='L251'><b>struct</b> relocation_info
<a name='L252'><font color='red'>{</font>
<a name='L253'><i><font color='green'>/* Address (within segment) to be relocated. */</font></i>
<a name='L254'><i><font color='green'>/* 需要重定位的地址(在段内)。*/</font></i>
<a name='L255'> <b>int</b> r_address;
<a name='L256'><i><font color='green'>/* The meaning of r_symbolnum depends on r_extern. */</font></i>
<a name='L257'><i><font color='green'>/* r_symbolnum 的含义与r_extern 有关。*/</font></i>
<a name='L258'> <b>unsigned</b> <b>int</b> r_symbolnum:24;
<a name='L259'><i><font color='green'>/* Nonzero means value is a pc-relative offset</font></i>
<a name='L260'><i><font color='green'>and it should be relocated for changes in its own address</font></i>
<a name='L261'><i><font color='green'>as well as for changes in the symbol or section specified. */</font></i>
<a name='L262'><i><font color='green'>/* 非零意味着值是一个pc 相关的偏移值,因而需要被重定位到自己</font></i>
<a name='L263'><i><font color='green'>的地址处以及符号或节指定的改变。 */</font></i>
<a name='L264'> <b>unsigned</b> <b>int</b> r_pcrel:1;
<a name='L265'><i><font color='green'>/* Length (as exponent of 2) of the field to be relocated.</font></i>
<a name='L266'><i><font color='green'>Thus, a value of 2 indicates 1<<2 bytes. */</font></i>
<a name='L267'><i><font color='green'>/* 需要被重定位的字段长度(是2 的次方)。</font></i>
<a name='L268'><i><font color='green'>因此,若值是2 则表示1<<2 字节数。*/</font></i>
<a name='L269'> <b>unsigned</b> <b>int</b> r_length:2;
<a name='L270'><i><font color='green'>/* 1 => relocate with value of symbol.</font></i>
<a name='L271'><i><font color='green'>r_symbolnum is the index of the symbol</font></i>
<a name='L272'><i><font color='green'>in file's the symbol table.</font></i>
<a name='L273'><i><font color='green'>0 => relocate with the address of a segment.</font></i>
<a name='L274'><i><font color='green'>r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS</font></i>
<a name='L275'><i><font color='green'>(the N_EXT bit may be set also, but signifies nothing). */</font></i>
<a name='L276'><i><font color='green'>/* 1 => 以符号的值重定位。</font></i>
<a name='L277'><i><font color='green'>r_symbolnum 是文件符号表中符号的索引。</font></i>
<a name='L278'><i><font color='green'>0 => 以段的地址进行重定位。</font></i>
<a name='L279'><i><font color='green'>r_symbolnum 是N_TEXT、N_DATA、N_BSS 或N_ABS</font></i>
<a name='L280'><i><font color='green'>(N_EXT 比特位也可以被设置,但是毫无意义)。*/</font></i>
<a name='L281'> <b>unsigned</b> <b>int</b> r_extern:1;
<a name='L282'><i><font color='green'>/* Four bits that aren't used, but when writing an object file</font></i>
<a name='L283'><i><font color='green'>it is desirable to clear them. */</font></i>
<a name='L284'><i><font color='green'>/* 没有使用的4 个比特位,但是当进行写一个目标文件时</font></i>
<a name='L285'><i><font color='green'>最好将它们复位掉。*/</font></i>
<a name='L286'> <b>unsigned</b> <b>int</b> r_pad:4;
<a name='L287'><font color='red'>}</font>;
<a name='L288'><font color='darkred'>#endif</font> <i><font color='green'>/* no N_RELOCATION_INFO_DECLARED. */</font></i>
<a name='L289'>
<a name='L290'>
<a name='L291'><font color='darkred'>#endif</font> <i><font color='green'>/* __A_OUT_GNU_H__ */</font></i>
</pre>
<hr>
<a name='BOTTOM'>
<i><font color='green'>/* [<][>][^][v]<a href='#TOP'>[top]</a>[bottom]<a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</font></i>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?