Specifications.
[pintos-anon] / specs / sysv-abi-update.html / ch4.sheader.html
1 <html>
2 <title>Sections </title><p>
3 <h1>Sections</h1><p>
4 An object file's section header table lets one
5 locate all the file's sections.
6 The section header table is an array of <code>Elf32_Shdr</code> 
7 or <code>Elf64_Shdr</code> structures
8 as described below.
9 A section header table index is a subscript into this array.
10 The ELF header's <code>e_shoff</code>
11 member gives the byte offset from the beginning of the
12 file to the section header table.
13 <code>e_shnum</code> normally tells how many entries the section header table contains.
14 <code>e_shentsize</code> gives the size in bytes of each entry.
15 <p>
16 If the number of sections is greater than or equal to
17 <code>SHN_LORESERVE</code> (<code>0xff00</code>), <code>e_shnum</code>
18 has the value <code>SHN_UNDEF</code> (<code>0</code>) and the
19 actual number of section header table
20 entries is contained in the <code>sh_size</code> field of
21 the section header at index <code>0</code>
22 (otherwise, the <code>sh_size</code> member of the initial entry 
23 contains <code>0</code>).
24 <p>
25 Some section header table indexes are reserved in contexts
26 where index size is restricted, for example, the <code>st_shndx</code>
27 member of a symbol table entry and the <code>e_shnum</code> and
28 <code>e_shstrndx</code> members of the ELF header.
29 In such contexts, the reserved values do not represent actual
30 sections in the object file.  Also in such contexts, an escape 
31 value indicates that the actual section
32 index is to be found elsewhere, in a larger field.
33 <hr>
34 <b>Figure 4-7: Special Section Indexes</b>
35 <p>
36 <table border cellspacing=0>
37 <th><b>Name</b></th>
38 <th><b>Value</b></th>
39 <tr>
40 <td><code>SHN_UNDEF</code></td>
41 <td align=right><code>0</code></td>
42 </tr>
43 <tr>
44 <td><code>SHN_LORESERVE</code></td>
45 <td align=right><code>0xff00</code></td>
46 </tr>
47 <tr>
48 <td><code>SHN_LOPROC</code></td>
49 <td align=right><code>0xff00</code></td>
50 </tr>
51 <tr>
52 <td><code>SHN_HIPROC</code></td>
53 <td align=right><code>0xff1f</code></td>
54 </tr>
55 <tr>
56 <td><code>SHN_LOOS</code></td>
57 <td align=right><code>0xff20</code></td>
58 </tr>
59 <tr>
60 <td><code>SHN_HIOS</code></td>
61 <td align=right><code>0xff3f</code></td>
62 </tr>
63 <tr>
64 <td><code>SHN_ABS</code></td>
65 <td align=right><code>0xfff1</code></td>
66 </tr>
67 <tr>
68 <td><code>SHN_COMMON</code></td>
69 <td align=right><code>0xfff2</code></td>
70 </tr>
71 <tr>
72 <td><code>SHN_XINDEX</code></td>
73 <td align=right><code>0xffff</code></td>
74 </tr>
75 <tr>
76 <td><code>SHN_HIRESERVE</code></td>
77 <td align=right><code>0xffff</code></td>
78 </tr>
79 </table>
80 <hr>
81 <p>
82 <DL COMPACT>
83 <p><dt><code>SHN_UNDEF</code><dd>
84 This value marks an undefined, missing, irrelevant, or
85 otherwise meaningless section reference.
86 For example, a symbol ``defined'' relative to section number
87 <code>SHN_UNDEF</code> is an undefined symbol.
88 </dl>
89 <hr>
90 <img src=warning.gif alt="NOTE:">
91 Although index 0 is reserved as the undefined value,
92 the section header table contains an entry for index 0.
93 If the <code>e_shnum</code>
94 member of the ELF header says a file has 6 entries
95 in the section header table, they have the indexes 0 through 5.
96 The contents of the initial entry are specified later in this
97 section.
98 <hr><p>
99 <DL COMPACT>
100 <p><dt><code>SHN_LORESERVE</code><dd>
101 This value specifies the lower bound of the
102 range of reserved indexes.
103 <p><dt><code>SHN_LOPROC</code>&nbsp;through&nbsp;<code>SHN_HIPROC</code><dd>
104 Values in this inclusive range
105 are reserved for processor-specific semantics.
106 <p><dt><code>SHN_LOOS</code>&nbsp;through&nbsp;<code>SHN_HIOS</code><dd>
107 Values in this inclusive range
108 are reserved for operating system-specific semantics.
109 <p><dt><code>SHN_ABS</code><dd>
110 This value specifies absolute values for the corresponding reference.
111 For example, symbols defined relative to section number <code>SHN_ABS</code>
112 have absolute values and are not affected by relocation.
113 <p><dt><code>SHN_COMMON</code><dd>
114 Symbols defined relative to this section are common symbols,
115 such as FORTRAN
116 <code>COMMON</code>
117 or unallocated C external variables.
118 <p><dt><code>SHN_XINDEX</code><dd>
119 This value is an escape value.
120 It indicates that the actual section header index is too large to fit
121 in the containing field and is to be found in another location
122 (specific to the structure where it appears).
123 <p><dt><code>SHN_HIRESERVE</code><dd>
124 This value specifies the upper bound of the
125 range of reserved indexes.
126 The system reserves indexes between <code>SHN_LORESERVE</code>
127 and <code>SHN_HIRESERVE</code>,
128 inclusive; the values do not reference the section header table.
129 The section header table does not
130 contain entries for the reserved indexes.
131 </dl>
132 <p>
133 Sections contain all information in an object file
134 except the ELF header, the program header table,
135 and the section header table.
136 Moreover, object files' sections satisfy several conditions.
137 <ul>
138 <p><li>
139 Every section in an object file has exactly one
140 section header describing it.
141 Section headers may exist that do not have a section.
142 <p><li>
143 Each section occupies one contiguous (possibly empty)
144 sequence of bytes within a file.
145 <p><li>
146 Sections in a file may not overlap.
147 No byte in a file resides in more than one section.
148 <p><li>
149 An object file may have inactive space.
150 The various headers and the sections might not
151 ``cover'' every byte in an object file.
152 The contents of the inactive data are unspecified.
153 </ul>
154 A section header has the following structure.
155 <hr>
156 <a name="section_header"></a>
157 <pre>
158 <b>Figure 4-8: Section Header</b>
159 <p>
160 <code>
161 typedef struct {
162         Elf32_Word      sh_name;
163         Elf32_Word      sh_type;
164         Elf32_Word      sh_flags;
165         Elf32_Addr      sh_addr;
166         Elf32_Off       sh_offset;
167         Elf32_Word      sh_size;
168         Elf32_Word      sh_link;
169         Elf32_Word      sh_info;
170         Elf32_Word      sh_addralign;
171         Elf32_Word      sh_entsize;
172 } Elf32_Shdr;
173
174 typedef struct {
175         Elf64_Word      sh_name;
176         Elf64_Word      sh_type;
177         Elf64_Xword     sh_flags;
178         Elf64_Addr      sh_addr;
179         Elf64_Off       sh_offset;
180         Elf64_Xword     sh_size;
181         Elf64_Word      sh_link;
182         Elf64_Word      sh_info;
183         Elf64_Xword     sh_addralign;
184         Elf64_Xword     sh_entsize;
185 } Elf64_Shdr;
186 </code>
187 </pre>
188 <hr>
189 <p>
190 <DL COMPACT>
191 <p><dt><code>sh_name</code><dd>
192 This member specifies the name of the section.
193 Its value is an index into the section header
194 string table section [see
195 <a href=ch4.strtab.html>``String Table''</a> below],
196 giving the location of a null-terminated string.
197 <p><dt><code>sh_type</code><dd>
198 This member categorizes the section's contents and semantics.
199 Section types and their descriptions appear
200 <a href="#sh_type">below</a>.
201 <p>
202 <p><dt><code>sh_flags</code><dd>
203 Sections support 1-bit flags that describe miscellaneous attributes.
204 Flag definitions appear 
205 <a href=#sh_flags>below</a>.
206 <p>
207 <p><dt><code>sh_addr</code><dd>
208 If the section will appear in the memory image of a process,
209 this member gives the address at which the section's first
210 byte should reside.
211 Otherwise, the member contains 0.
212 <p><dt><code>sh_offset</code><dd>
213 This member's value gives the byte offset from the beginning of the file
214 to the first byte in the section.
215 One section type, <code>SHT_NOBITS</code>
216 described
217 <a href=#sh_type>below</a>,
218 occupies no space in the file, and its
219 <code>sh_offset</code> member locates the conceptual placement in the file.
220 <p><dt><code>sh_size</code><dd>
221 This member gives the section's size in bytes.
222 Unless the section type is
223 <code>SHT_NOBITS</code>, the section occupies <code>sh_size</code>
224 bytes in the file.
225 A section of type <code>SHT_NOBITS</code>
226 may have a non-zero size, but it occupies no space in the file.
227 <p><dt><code>sh_link</code><dd>
228 This member holds a section header table index link,
229 whose interpretation depends on the section type.
230 A <a href=#sh_link>table </a> below
231 describes the values.
232 <p><dt><code>sh_info</code><dd>
233 This member holds extra information,
234 whose interpretation depends on the section type.
235 A <a href=#sh_link>table</a> below
236 describes the values.  If the <code>sh_flags</code> field for this
237 section header includes the attribute <a href=#shf_info_link><code>SHF_INFO_LINK</code></a>, then this member represents a section header table index.
238 <p><dt><code>sh_addralign</code><dd>
239 Some sections have address alignment constraints.
240 For example, if a section holds a doubleword,
241 the system must ensure doubleword alignment for the entire section.
242 The value of <code>sh_addr</code>
243 must be congruent to 0, modulo the value of <code>sh_addralign</code>.
244 Currently, only 0 and positive integral powers of two are allowed.
245 Values 0 and 1 mean the section has no alignment constraints.
246 <p><dt><code>sh_entsize</code><dd>
247 Some sections hold a table of fixed-size entries,
248 such as a symbol table.
249 For such a section, this member gives the size in bytes of each entry.
250 The member contains 0 if the section does not hold a table
251 of fixed-size entries.
252 </dl>
253 <p>
254 A section header's <code>sh_type</code> member specifies the section's semantics.
255 <hr>
256 <a name="sh_type"</a>
257 <b>Figure 4-9: Section Types,</b><code>sh_type</code></b>
258 <p>
259 <table border cellspacing=0>
260 <th><b>Name</b></th>
261 <th><b>Value</b></th>
262 <tr>
263 <td><code>SHT_NULL</code></td>
264 <td align=right><code>0</code></td>
265 </tr>
266 <tr>
267 <td><code>SHT_PROGBITS</code></td>
268 <td align=right><code>1</code></td>
269 </tr>
270 <tr>
271 <td><code>SHT_SYMTAB</code></td>
272 <td align=right><code>2</code></td>
273 </tr>
274 <tr>
275 <td><code>SHT_STRTAB</code></td>
276 <td align=right><code>3</code></td>
277 </tr>
278 <tr>
279 <td><code>SHT_RELA</code></td>
280 <td align=right><code>4</code></td>
281 </tr>
282 <tr>
283 <td><code>SHT_HASH</code></td>
284 <td align=right><code>5</code></td>
285 </tr>
286 <tr>
287 <td><code>SHT_DYNAMIC</code></td>
288 <td align=right><code>6</code></td>
289 </tr>
290 <tr>
291 <td><code>SHT_NOTE</code></td>
292 <td align=right><code>7</code></td>
293 </tr>
294 <tr>
295 <td><code>SHT_NOBITS</code></td>
296 <td align=right><code>8</code></td>
297 </tr>
298 <tr>
299 <td><code>SHT_REL</code></td>
300 <td align=right><code>9</code></td>
301 </tr>
302 <tr>
303 <td><code>SHT_SHLIB</code></td>
304 <td align=right><code>10</code></td>
305 </tr>
306 <tr>
307 <td><code>SHT_DYNSYM</code></td>
308 <td align=right><code>11</code></td>
309 </tr>
310 <tr>
311 <td><code>SHT_INIT_ARRAY</code></td>
312 <td align=right><code>14</code></td>
313 </tr>
314 <tr>
315 <td><code>SHT_FINI_ARRAY</code></td>
316 <td align=right><code>15</code></td>
317 </tr>
318 <tr>
319 <td><code>SHT_PREINIT_ARRAY</code></td>
320 <td align=right><code>16</code></td>
321 </tr>
322 <tr>
323 <td><code>SHT_GROUP</code></td>
324 <td align=right><code>17</code></td>
325 </tr>
326 <tr>
327 <td><code>SHT_SYMTAB_SHNDX</code></td>
328 <td align=right><code>18</code></td>
329 </tr>
330 <td><code>SHT_LOOS</code></td>
331 <td align=right><code>0x60000000</code></td>
332 </tr>
333 <tr>
334 <td><code>SHT_HIOS</code></td>
335 <td align=right><code>0x6fffffff</code></td>
336 </tr>
337 <tr>
338 <td><code>SHT_LOPROC</code></td>
339 <td align=right><code>0x70000000</code></td>
340 </tr>
341 <tr>
342 <td><code>SHT_HIPROC</code></td>
343 <td align=right><code>0x7fffffff</code></td>
344 </tr>
345 <tr>
346 <td><code>SHT_LOUSER</code></td>
347 <td align=right><code>0x80000000</code></td>
348 </tr>
349 <tr>
350 <td><code>SHT_HIUSER</code></td>
351 <td align=right><code>0xffffffff</code></td>
352 </tr>
353 </table>
354 <hr>
355 <p>
356 <DL COMPACT>
357 <p><dt><code>SHT_NULL</code><dd>
358 This value marks the section header as inactive;
359 it does not have an associated section.
360 Other members of the section header have undefined values.
361 <p><dt><code>SHT_PROGBITS</code><dd>
362 The section holds information defined by the program,
363 whose format and meaning are determined solely by the program.
364 <p><dt><code>SHT_SYMTAB</code>&nbsp;and&nbsp;<code>SHT_DYNSYM</code><dd>
365 These sections hold a symbol table.
366 Currently, an object file may have only one section of each type,
367 but this restriction may be relaxed in the future.
368 Typically, <code>SHT_SYMTAB</code>
369 provides symbols for link editing, though it may also be
370 used for dynamic linking.
371 As a complete symbol table, it may contain many symbols unnecessary
372 for dynamic linking.
373 Consequently, an object file may also contain a <code>SHT_DYNSYM</code>
374 section, which holds a minimal set of dynamic linking symbols,
375 to save space.
376 See <a href=ch4.symtab.html>``Symbol Table''</a> below
377 for details.
378 <p><dt><code>SHT_STRTAB</code><dd>
379 The section holds a string table.
380 An object file may have multiple string table sections.
381 See <a href=ch4.strtab.html>``String Table''</a>
382 below for details.
383 <p><dt><code>SHT_RELA</code><dd>
384 The section holds relocation entries
385 with explicit addends, such as type
386 <code>Elf32_Rela</code> for the 32-bit class of object files
387 or type <code>Elf64_Rela</code> for the 64-bit class of object files.
388 An object file may have multiple relocation sections.
389 <a href=ch4.reloc.html>``Relocation''</a>
390 below for details.
391 <p><dt><code>SHT_HASH</code><dd>
392 The section holds a symbol hash table.
393 Currently, an object file may have only one hash table,
394 but this restriction may be relaxed in the future.
395 See 
396 <a href=ch5.dynamic.html#hash>``Hash Table''</a>
397 in the Chapter 5 for details.
398 <p><dt><code>SHT_DYNAMIC</code><dd>
399 The section holds information for dynamic linking.
400 Currently, an object file may have only one dynamic section,
401 but this restriction may be relaxed in the future.
402 See 
403 <a href=ch5.dynamic.html#dynamic_section>``Dynamic Section''</a>
404 in Chapter 5 for details.
405 <p><dt><code>SHT_NOTE</code><dd>
406 The section holds information that marks the file in some way.
407 See 
408 <a href=ch5.pheader.html#note_section>``Note Section''</a>
409 in Chapter 5 for details.
410 <p><dt><code>SHT_NOBITS</code><dd>
411 A section of this type occupies no space in the file but
412 otherwise resembles
413 <code>SHT_PROGBITS</code>.
414 Although this section contains no bytes, the <code>sh_offset</code>
415 member contains the conceptual file offset.
416 <p><dt><code>SHT_REL</code><dd>
417 The section holds relocation entries
418 without explicit addends, such as type
419 <code>Elf32_Rel</code> for the 32-bit class of object files or
420 type <code>Elf64_Rel</code> for the 64-bit class of object files.
421 An object file may have multiple relocation sections.
422 See <a href=ch4.reloc.html>``Relocation''</a>
423 below for details.
424 <p><dt><code>SHT_SHLIB</code><dd>
425 This section type is reserved but has unspecified semantics.
426 <a name=init_array></a>
427 <p><dt><code>SHT_INIT_ARRAY</code><dd>
428 This section contains an array of pointers to initialization functions,
429 as described in <a href=ch5.dynamic.html#init_fini>``Initialization and
430 Termination Functions''</a> in Chapter 5.  Each pointer in the array
431 is taken as a parameterless procedure with a void return.
432 <p><dt><code>SHT_FINI_ARRAY</code><dd>
433 This section contains an array of pointers to termination functions,
434 as described in <a href=ch5.dynamic.html#init_fini>``Initialization and
435 Termination Functions''</a> in Chapter 5.  Each pointer in the array
436 is taken as a parameterless procedure with a void return.
437 <p><dt><code>SHT_PREINIT_ARRAY</code><dd>
438 This section contains an array of pointers to functions that are
439 invoked before all other initialization functions,
440 as described in <a href=ch5.dynamic.html#init_fini>``Initialization and
441 Termination Functions''</a> in Chapter 5.  Each pointer in the array
442 is taken as a parameterless procedure with a void return.
443 <p><dt><code>SHT_GROUP</code><dd>
444 This section defines a section group.  A section group
445 is a set of sections that are related and that must be treated
446 specially by the linker (see <a href=#section_groups>below</a> for further
447 details).  Sections of type <code>SHT_GROUP</code> may appear only
448 in relocatable objects (objects with the ELF header <code>e_type</code>
449 member set to <code>ET_REL</code>).   The section header table entry
450 for a group section must appear in the section header table
451 before the entries for any of the sections that are members of
452 the group.
453 <p><dt><code>SHT_SYMTAB_SHNDX</code><dd>
454 <a name=many_sections></a>
455 This section is associated with a section of type <code>SHT_SYMTAB</code>
456 and is required if any of the section header indexes referenced
457 by that symbol table contain the escape value <code>SHN_XINDEX</code>.
458 The section is an array of <code>Elf32_Word</code> values.
459 Each value corresponds one to one with a symbol table entry
460 and appear in the same order as those entries.
461 The values represent the section header indexes against which
462 the symbol table entries are defined.
463 Only if corresponding symbol table entry's <code>st_shndx</code> field
464 contains the escape value <code>SHN_XINDEX</code>
465 will the matching <code>Elf32_Word</code> hold the actual section header index;
466 otherwise, the entry must be <code>SHN_UNDEF</code> (<code>0</code>).
467 <p><dt><code>SHT_LOOS</code>&nbsp;through&nbsp;<code>SHT_HIOS</code><dd>
468 Values in this inclusive range
469 are reserved for operating system-specific semantics.
470 <p><dt><code>SHT_LOPROC</code>&nbsp;through&nbsp;<code>SHT_HIPROC</code><dd>
471 Values in this inclusive range
472 are reserved for processor-specific semantics.
473 <p><dt><code>SHT_LOUSER</code><dd>
474 This value specifies the lower bound of the range of
475 indexes reserved for application programs.
476 <p><dt><code>SHT_HIUSER</code><dd>
477 This value specifies the upper bound of the range of
478 indexes reserved for application programs.
479 Section types between <code>SHT_LOUSER</code> and
480 <code>SHT_HIUSER</code> may be used by the application, without conflicting with
481 current or future system-defined section types.
482 </dl>
483 <p>
484 Other section type values are reserved.
485 As mentioned before, the section header for index 0 (<code>SHN_UNDEF</code>)
486 exists, even though the index marks undefined section references.
487 This entry holds the following.
488 <hr>
489 <b>Figure 4-10: Section Header Table Entry:Index 0</b>
490 <p>
491 <table border cellspacing=0>
492 <th><b>Name</b></th>
493 <th><b>Value</b></th>
494 <th><b>Note</b></th>
495 <tr>
496 <td><code>sh_name</code></td>
497 <td align=center><code>0</code></td>
498 <td>No name</td>
499 </tr>
500 <tr>
501 <td><code>sh_type</code></td>
502 <td align=center><code>SHT_NULL</code></td>
503 <td>Inactive</td>
504 </tr>
505 <tr>
506 <td><code>sh_flags</code></td>
507 <td align=center><code>0</code></td>
508 <td>No flags</td>
509 </tr>
510 <tr>
511 <td><code>sh_addr</code></td>
512 <td align=center><code>0</code></td>
513 <td>No address</td>
514 </tr>
515 <tr>
516 <td><code>sh_offset</code></td>
517 <td align=center><code>0</code></td>
518 <td>No offset</td>
519 </tr>
520 <tr>
521 <td><code>sh_size</code></td>
522 <td align=center>Unspecified</td>
523 <td>If non-zero, the actual number of section header entries</td>
524 </tr>
525 <tr>
526 <td><code>sh_link</code></td>
527 <td align=center>Unspecified</td>
528 <td>If non-zero, the index of the section header string table section</td>
529 </tr>
530 <tr>
531 <td><code>sh_info</code></td>
532 <td align=center><code>0</code></td>
533 <td>No auxiliary information</td>
534 </tr>
535 <tr>
536 <td><code>sh_addralign</code></td>
537 <td align=center><code>0</code></td>
538 <td>No alignment</td>
539 </tr>
540 <tr>
541 <td><code>sh_entsize</code></td>
542 <td align=center><code>0</code></td>
543 <td>No entries</td>
544 </tr>
545 </table>
546 <hr>
547 <p>
548 A section header's <code>sh_flags</code>
549 member holds 1-bit flags that describe the section's attributes.
550 Defined values appear in the following table;
551 other values are reserved.
552 <a name="sh_flags"</a>
553 <hr>
554 <b>Figure 4-11: Section Attribute Flags</b>
555 <p>
556 <table border cellspacing=0>
557 <th>Name</th>
558 <th>Value</th>
559 <tr>
560 <td><code>SHF_WRITE</code></td>
561 <td align=right><code>0x1</code></td>
562 </tr>
563 <tr>
564 <td><code>SHF_ALLOC</code></td>
565 <td align=right><code>0x2</code></td>
566 </tr>
567 <tr>
568 <td><code>SHF_EXECINSTR</code></td>
569 <td align=right><code>0x4</code></td>
570 </tr>
571 <tr>
572 <td><code>SHF_MERGE</code></td>
573 <td align=right><code>0x10</code></td>
574 </tr>
575 <tr>
576 <td><code>SHF_STRINGS</code></td>
577 <td align=right><code>0x20</code></td>
578 </tr>
579 <tr>
580 <td><code>SHF_INFO_LINK</code></td>
581 <td align=right><code>0x40</code></td>
582 </tr>
583 <tr>
584 <td><code>SHF_LINK_ORDER</code></td>
585 <td align=right><code>0x80</code></td>
586 </tr>
587 <tr>
588 <td><code>SHF_OS_NONCONFORMING</code></td>
589 <td align=right><code>0x100</code></td>
590 </tr>
591 <tr>
592 <td><code>SHF_GROUP</code></td>
593 <td align=right><code>0x200</code></td>
594 </tr>
595 <tr>
596 <td><code>SHF_TLS</code></td>
597 <td align=right><code>0x400</code></td>
598 </tr>
599 <tr>
600 <td><code>SHF_MASKOS</code></td>
601 <td align=right><code>0x0ff00000</code></td>
602 </tr>
603 <tr>
604 <td><code>SHF_MASKPROC</code></td>
605 <td align=right><code>0xf0000000</code></td>
606 </tr>
607 </table>
608 <hr>
609 <p>
610 If a flag bit is set in <code>sh_flags</code>,
611 the attribute is ``on'' for the section.
612 Otherwise, the attribute is ``off'' or does not apply.
613 Undefined attributes are set to zero.
614 <DL COMPACT>
615 <p><dt><code>SHF_WRITE</code><dd>
616 The section contains data that should be writable during
617 process execution.
618 <p><dt><code>SHF_ALLOC</code><dd>
619 The section occupies memory during process execution.
620 Some control sections do not reside in the memory image
621 of an object file; this attribute is off for those sections.
622 <p><dt><code>SHF_EXECINSTR</code><dd>
623 The section contains executable machine instructions.
624 <a name=shf_merge></a>
625 <p><dt><code>SHF_MERGE</code><dd>
626 The data in the section may be merged to eliminate duplication. 
627 Unless the <code>SHF_STRINGS</code> flag is also set,
628 the data elements in the section are of a uniform size.
629 The size of each element is specified in the section 
630 header's <code>sh_entsize</code> field. 
631 If the <code>SHF_STRINGS</code> flag is also set,
632 the data elements consist of null-terminated character strings.
633 The size of each character is specified in the section
634 header's <code>sh_entsize</code> field. 
635 <p>
636 Each element in the section is compared against other elements
637 in sections with the same name, type and flags.
638 Elements that would have identical values at program run-time
639 may be merged. 
640 Relocations referencing elements of such sections must be
641 resolved to the merged locations of the referenced values.
642 Note that any relocatable values, including
643 values that would result in run-time relocations, must be
644 analyzed to determine whether the run-time values would actually
645 be identical.  An ABI-conforming object file may not depend 
646 on specific elements being merged, and an ABI-conforming 
647 link editor may choose not to merge specific elements.
648 <a name=shf_strings></a>
649 <p><dt><code>SHF_STRINGS</code><dd>
650 The data elements in the section consist of null-terminated character
651 strings.  The size of each character is specified in the section 
652 header's <code>sh_entsize</code> field. 
653 <a name=shf_info_link></a>
654 <p><dt><code>SHF_INFO_LINK</code><dd>
655 The <code>sh_info</code> field of this section header holds a section
656 header table index.
657 <a name=shf_link_order></a>
658 <p><dt><code>SHF_LINK_ORDER</code><dd>
659 This flag adds special ordering requirements for link editors.
660 The requirements apply if the 
661 <code>sh_link</code> field of this section's header references 
662 another section (the linked-to section).  
663 If this section is combined with other
664 sections in the output file, it must appear in the same 
665 relative order with respect to those sections, as the linked-to section
666 appears with respect to sections the linked-to section is combined with.
667 <p>
668 <hr>
669 <img src=warning.gif alt="NOTE:">
670 A typical use of this flag is to build a table that references text or
671 data sections in address order.
672 <hr>
673 <a name=shf_os_nonconforming></a>
674 <p><dt><code>SHF_OS_NONCONFORMING</code><dd>
675 This section requires special OS-specific processing
676 (beyond the standard <a href=#linking_rules>linking rules</a>)
677 to avoid incorrect behavior.
678 If this section has either an <code>sh_type</code> value
679 or contains <code>sh_flags</code> bits in the OS-specific ranges for
680 those fields, and a link editor processing this section does not
681 recognize those values, then the link editor should reject
682 the object file containing this section with an error.
683 <p><dt><code>SHF_GROUP</code><dd>
684 This section is a member (perhaps the only one) of a section group.
685 The section must be referenced by a section of type <code>SHT_GROUP</code>.
686 The <code>SHF_GROUP</code> flag may be set only for sections contained
687 in relocatable objects (objects with the ELF header <code>e_type</code>
688 member set to <code>ET_REL</code>).
689 See <a href=#section_groups>below</a> for further details.
690 <a name=shf_tls></a>
691 <p><dt><code>SHF_TLS</code><dd>
692 This section holds <i>Thread-Local Storage</i>,
693 meaning that each separate execution flow
694 has its own distinct instance of this data.
695 Implementations need not support this flag.
696 <p><dt><code>SHF_MASKOS</code><dd>
697 All bits included in this mask
698 are reserved for operating system-specific semantics.
699 <p><dt><code>SHF_MASKPROC</code><dd>
700 All bits included in this mask
701 are reserved for processor-specific semantics.
702 If meanings are specified, the processor supplement explains
703 them.
704 </dl>
705 <p>
706 Two members in the section header,
707 <code>sh_link</code> and <code>sh_info</code>,
708 hold special information, depending on section type.
709 <hr>
710 <a name="sh_link"></a>
711 <b>Figure 4-12:</b> <code>sh_link</code> <b>and</b> <code>sh_info</code> <b>Interpretation</b>
712 <p>
713 <table border cellspacing=0>
714 <th><code>sh_type</code></th>
715 <th><code>sh_link</code></th>
716 <th><code>sh_info</code></th>
717 <tr>
718 <td><code>SHT_DYNAMIC</code></td>
719 <td>The section header index of
720 the string table used by
721 entries in the section.</td>
722 <td><code>0</code></td>
723 </tr>
724 <tr>
725 <td><code>SHT_HASH</code></td>
726 <td>The section header index of
727 the symbol table to which
728 the hash table applies.</td>
729 <td><code>0</code></td>
730 </tr>
731 <tr>
732 <td><code>SHT_REL</code><br><code>SHT_RELA</code></td>
733 <td>The section header index of
734 the associated symbol table.</td>
735 <td>The section header index of
736 the section to which the
737 relocation applies.</td>
738 </tr>
739 <tr>
740 <td><code>SHT_SYMTAB</code><br><code>SHT_DYNSYM</code></td>
741 <td>The section header index of
742 the associated string table.</td>
743 <td>One greater than the symbol table index of the last local
744 symbol (binding <code>STB_LOCAL</code>).</td>
745 </tr>
746 <tr>
747 <td><code>SHT_GROUP</code></td>
748 <td>The section header index of
749 the associated symbol table.</td>
750 <td>The symbol table index of an entry in the
751 associated symbol table.  The name of the specified symbol table
752 entry provides a signature for the section group.</td>
753 </tr>
754 <td><code>SHT_SYMTAB_SHNDX</code></td>
755 <td>The section header index of
756 the associated symbol table section.</td>
757 <td><code>0</code></td>
758 </tr>
759 <tr>
760 </table>
761 <hr>
762 <a name="linking_rules"></a>
763 <h2>Rules for Linking Unrecognized Sections</h2>
764 If a link editor encounters sections whose headers contain OS-specific
765 values it does not recognize in the <code>sh_type</code>
766 or <code>sh_flags</code> fields, the link editor should combine those
767 sections as described below.
768 <p>
769 If the section's <code>sh_flags</code> bits include the attribute
770 <code>SHF_OS_NONCONFORMING</code>, then the section requires
771 special knowledge to be correctly processed, and the link editor should
772 reject the object containing the section with an error.
773 <p>
774 Unrecognized sections that do not have the
775 <code>SHF_OS_NONCONFORMING</code> attribute, are combined in a two-phase
776 process.  As the link editor combines sections using this process,
777 it must honor the alignment constraints of the 
778 input sections (asserted by the <code>sh_addralign</code> field),
779 padding between sections with zero bytes, if necessary, and producing
780 a combination with the maximum alignment constraint of its
781 component input sections. 
782 <p>
783 <ol>
784 <li>
785 In the first phase, input sections that match in name, type
786 and attribute flags should be concatenated into single sections.
787 The concatenation order should satisfy the requirements of
788 any known input section attributes (e.g, <code>SHF_MERGE</code>
789 and <code>SHF_LINK_ORDER</code>).  When not otherwise constrained,
790 sections should be emitted in input order.
791 <li>
792 In the second phase, sections should be assigned to segments or
793 other units based on their attribute flags.  Sections of each particular
794 unrecognized type should be assigned to the same unit unless
795 prevented by incompatible flags, and within a unit, sections
796 of the same unrecognized type should be placed together
797 if possible.
798 </ol>
799 <p>
800 Non OS-specific processing (e.g. relocation) should be applied
801 to unrecognized section types.  An output section header table,
802 if present, should contain entries for unknown sections.
803 Any unrecognized section attribute flags should be removed.
804 <hr>
805 <img src=warning.gif alt="NOTE:">
806 It is recommended that link editors follow the same two-phase
807 ordering approach described above when linking sections of
808 known types.  Padding between such sections may have values
809 different from zero, where appropriate.
810 <hr>
811 <a name="section_groups"></a>
812 <h2>Section Groups</h2>
813 Some sections occur in interrelated groups.  For example, an out-of-line
814 definition of an inline function might require, in addition to the
815 section containing its executable instructions, a read-only data 
816 section containing literals referenced, one or more debugging information
817 sections and other informational sections.  Furthermore, there may be
818 internal references among these sections that would not make sense
819 if one of the sections were removed or replaced by a duplicate from
820 another object.  Therefore, such groups must be
821 included or omitted from the linked object as a unit.
822 A section cannot be a member of more than one group.
823 <p>
824 A section of type <code>SHT_GROUP</code> defines such a grouping
825 of sections. The name of a symbol from one of the containing 
826 object's symbol tables provides a signature for the section group.
827 The section header of the <code>SHT_GROUP</code> section specifies
828 the identifying symbol entry, as described above:
829 the <code>sh_link</code> member contains the section header index
830 of the symbol table section that contains the entry.  
831 The <code>sh_info</code> member contains the symbol table index of 
832 the identifying entry.   The <code>sh_flags</code>
833 member of the section header contains <code>0</code>. 
834 The name of the section (<code>sh_name</code>) is not specified.
835 <p>
836 The referenced signature symbol is not restricted.
837 Its containing symbol table section need not be a member of the group,
838 for example.
839 <p>
840 The section data of a <code>SHT_GROUP</code> section is an array
841 of <code>Elf32_Word</code> entries.  The first entry is a flag word.
842 The remaining entries are a sequence of section header indices.
843 <p>
844 The following flags are currently defined:
845 <hr>
846 <a name="section_group_flags"></a>
847 <b>Figure 4-13: Section Group Flags</b>
848 <p>
849 <table border cellspacing=0>
850 <th>Name</th>
851 <th>Value</th>
852 <tr>
853 <td><code>GRP_COMDAT</code></td>
854 <td align=right><code>0x1</code></td>
855 </tr>
856 <tr>
857 <td><code>GRP_MASKOS</code></td>
858 <td align=right><code>0x0ff00000</code></td>
859 </tr>
860 <tr>
861 <td><code>GRP_MASKPROC</code></td>
862 <td align=right><code>0xf0000000</code></td>
863 </tr>
864 </table>
865 <hr>
866 <DL COMPACT>
867 <p><dt><code>GRP_COMDAT</code><dd>
868 This is a COMDAT group.  It may duplicate another COMDAT group
869 in another object file, where duplication is defined as having the
870 same group signature.  In such cases, only one of the
871 duplicate groups may be retained by the linker, and the
872 members of the remaining groups must be discarded.
873 <p><dt><code>GRP_MASKOS</code><dd>
874 All bits included in this mask
875 are reserved for operating system-specific semantics.
876 <p><dt><code>GRP_MASKPROC</code><dd>
877 All bits included in this mask
878 are reserved for processor-specific semantics.
879 If meanings are specified, the processor supplement explains
880 them.
881 </dl>
882 <p>
883 The section header indices in the <code>SHT_GROUP</code> section
884 identify the sections that make up the group.  Each such section
885 must have the <code>SHF_GROUP</code> flag set in its <code>sh_flags</code>
886 section header member.  If the linker decides to remove the section
887 group, it must remove all members of the group.
888 <hr>
889 <img src=warning.gif alt="NOTE:">
890 This requirement is not intended to imply that special case behavior
891 like removing debugging information requires removing the sections
892 to which that information refers, even if they are part of the same
893 group.
894 <hr>
895 <p>
896 <a name="section_group_rules"></a>
897 To facilitate removing a group without leaving dangling references
898 and with only minimal processing of the symbol table, 
899 the following rules must be followed:
900 <ul>
901 <p><li>
902 A symbol table entry with <code>STB_GLOBAL</code> or <code>STB_WEAK</code>
903 binding that is defined relative to one of a group's sections,
904 and that is contained in a symbol table section
905 that is not part of the group,
906 must be converted to an undefined symbol
907 (its section index must be changed to <code>SHN_UNDEF</code>)
908 if the group members are discarded.
909 References to this symbol table entry from outside the group are allowed.
910 <p><li>
911 A symbol table entry with <code>STB_LOCAL</code> binding
912 that is defined relative to one of a group's sections,
913 and that is contained in a symbol table section
914 that is not part of the group,
915 must be discarded if the group members are discarded.
916 References to this symbol table entry from outside the group are not allowed.
917 <p><li>
918 An undefined symbol that is referenced only from one or more sections
919 that are part of a particular group,
920 and that is contained in a symbol table section
921 that is not part of the group,
922 is not removed when the group members are discarded.
923 In other words,
924 the undefined symbol is not removed
925 even if no references to that symbol remain.
926 <p><li>
927 There may not be non-symbol references to the sections comprising
928 a group from outside the group, for example, use of a group
929 member's section header index in an <code>sh_link</code> or
930 <code>sh_info</code> member.
931 </ul>
932 <a name="special_sections"></a>
933 <h2>Special Sections</h2>
934 Various sections hold program and control information.
935 <p>
936 The following table
937 shows sections that are used by the system
938 and have the indicated types and attributes.
939 <hr>
940 <b>Figure 4-14: Special Sections</b>
941 <p>
942 <table border cellspacing=0>
943 <th><b>Name</b></th>
944 <th><b>Type</b></th>
945 <th><b>Attributes</b></th>
946 <tr>
947 <td><code>.bss</code>       </td>
948 <td><code>SHT_NOBITS</code>  </td>
949 <td><code>SHF_ALLOC+SHF_WRITE</code> </td>
950 </tr>
951 <tr>
952 <td><code>.comment</code>   </td>
953 <td><code>SHT_PROGBITS</code></td>
954 <td>none</td>
955 </tr>
956 <tr>
957 <td><code>.data</code>      </td>
958 <td><code>SHT_PROGBITS</code></td>
959 <td><code>SHF_ALLOC+SHF_WRITE</code> </td>
960 </tr>
961 <tr>
962 <td><code>.data1</code>     </td>
963 <td><code>SHT_PROGBITS</code></td>
964 <td><code>SHF_ALLOC+SHF_WRITE</code> </td>
965 </tr>
966 <tr>
967 <td><code>.debug</code>     </td>
968 <td><code>SHT_PROGBITS</code></td>
969 <td>none</td>
970 </tr>
971 <tr>
972 <td><code>.dynamic</code>   </td>
973 <td><code>SHT_DYNAMIC</code> </td>
974 <td>see below</td>
975 </tr>
976 <tr>
977 <td><code>.dynstr</code>    </td>
978 <td><code>SHT_STRTAB</code>  </td>
979 <td><code>SHF_ALLOC</code> </td>
980 </tr>
981 <tr>
982 <td><code>.dynsym</code>    </td>
983 <td><code>SHT_DYNSYM</code>  </td>
984 <td><code>SHF_ALLOC</code> </td>
985 </tr>
986 <tr>
987 <td><code>.fini</code>      </td>
988 <td><code>SHT_PROGBITS</code></td>
989 <td><code>SHF_ALLOC+SHF_EXECINSTR</code> </td>
990 </tr>
991 <tr>
992 <td><code>.fini_array</code>      </td>
993 <td><code>SHT_FINI_ARRAY</code></td>
994 <td><code>SHF_ALLOC+SHF_WRITE</code> </td>
995 </tr>
996 <tr>
997 <td><code>.got</code>       </td>
998 <td><code>SHT_PROGBITS</code></td>
999 <td>see below</td>
1000 </tr>
1001 <tr>
1002 <td><code>.hash</code>      </td>
1003 <td><code>SHT_HASH</code>    </td>
1004 <td><code>SHF_ALLOC</code> </td>
1005 </tr>
1006 <tr>
1007 <td><code>.init</code>      </td>
1008 <td><code>SHT_PROGBITS</code></td>
1009 <td><code>SHF_ALLOC+SHF_EXECINSTR</code> </td>
1010 </tr>
1011 <tr>
1012 <td><code>.init_array</code>      </td>
1013 <td><code>SHT_INIT_ARRAY</code></td>
1014 <td><code>SHF_ALLOC+SHF_WRITE</code> </td>
1015 </tr>
1016 <tr>
1017 <td><code>.interp</code>    </td>
1018 <td><code>SHT_PROGBITS</code></td>
1019 <td>see below</td>
1020 </tr>
1021 <tr>
1022 <td><code>.line</code>      </td>
1023 <td><code>SHT_PROGBITS</code></td>
1024 <td>none</td>
1025 </tr>
1026 <tr>
1027 <td><code>.note</code>      </td>
1028 <td><code>SHT_NOTE</code>    </td>
1029 <td>none</td>
1030 </tr>
1031 <tr>
1032 <td><code>.plt</code>       </td>
1033 <td><code>SHT_PROGBITS</code></td>
1034 <td>see below</td>
1035 </tr>
1036 <tr>
1037 <td><code>.preinit_array</code>      </td>
1038 <td><code>SHT_PREINIT_ARRAY</code></td>
1039 <td><code>SHF_ALLOC+SHF_WRITE</code> </td>
1040 </tr>
1041 <tr>
1042 <td><code>.rel</code><i>name</i>   </td>
1043 <td><code>SHT_REL</code>     </td>
1044 <td>see below</td>
1045 </tr>
1046 <tr>
1047 <td><code>.rela</code><i>name</i>  </td>
1048 <td><code>SHT_RELA</code>    </td>
1049 <td>see below</td>
1050 </tr>
1051 <tr>
1052 <td><code>.rodata</code>    </td>
1053 <td><code>SHT_PROGBITS</code></td>
1054 <td><code>SHF_ALLOC</code> </td>
1055 </tr>
1056 <tr>
1057 <td><code>.rodata1</code>   </td>
1058 <td><code>SHT_PROGBITS</code></td>
1059 <td><code>SHF_ALLOC</code> </td>
1060 </tr>
1061 <tr>
1062 <td><code>.shstrtab</code>  </td>
1063 <td><code>SHT_STRTAB</code>  </td>
1064 <td>none</td>
1065 </tr>
1066 <tr>
1067 <td><code>.strtab</code>    </td>
1068 <td><code>SHT_STRTAB</code>  </td>
1069 <td>see below</td>
1070 </tr>
1071 <tr>
1072 <td><code>.symtab</code>    </td>
1073 <td><code>SHT_SYMTAB</code>  </td>
1074 <td>see below</td>
1075 </tr>
1076 <tr>
1077 <td><code>.symtab_shndx</code></td>
1078 <td><code>SHT_SYMTAB_SHNDX</code>  </td>
1079 <td>see below</td>
1080 </tr>
1081 <tr>
1082 <td><code>.tbss</code>      </td>
1083 <td><code>SHT_NOBITS</code></td>
1084 <td><code>SHF_ALLOC+SHF_WRITE+SHF_TLS</code> </td>
1085 </tr>
1086 <tr>
1087 <td><code>.tdata</code>     </td>
1088 <td><code>SHT_PROGBITS</code></td>
1089 <td><code>SHF_ALLOC+SHF_WRITE+SHF_TLS</code> </td>
1090 </tr>
1091 <tr>
1092 <td><code>.tdata1</code>    </td>
1093 <td><code>SHT_PROGBITS</code></td>
1094 <td><code>SHF_ALLOC+SHF_WRITE+SHF_TLS</code> </td>
1095 </tr>
1096 <tr>
1097 <td><code>.text</code>      </td>
1098 <td><code>SHT_PROGBITS</code></td>
1099 <td><code>SHF_ALLOC+SHF_EXECINSTR</code> </td>
1100 </tr>
1101 </table>
1102 <hr>
1103 <p>
1104 <dl>
1105 <p><dt><code>.bss</code><dd>
1106 This section holds uninitialized data that contribute
1107 to the program's memory image.
1108 By definition, the system initializes the data with zeros
1109 when the program begins to run.
1110 The section occupies no file space, as indicated by the section type,
1111 <code>SHT_NOBITS</code>.
1112 <p><dt><code>.comment</code><dd>
1113 This section holds version control information.
1114 <p><dt><code>.data</code>&nbsp;and&nbsp;<code>.data1</code><dd>
1115 These sections hold initialized data that contribute
1116 to the program's memory image.
1117 <p><dt><code>.debug</code><dd>
1118 This section holds information for symbolic debugging.
1119 The contents are unspecified.  All section names with the
1120 prefix <code>.debug</code> are reserved for future use in the
1121 ABI.
1122 <p><dt><code>.dynamic</code><dd>
1123 This section holds dynamic linking information.
1124 The section's attributes will include the <code>SHF_ALLOC</code> bit.
1125 Whether the <code>SHF_WRITE</code> bit is set is processor specific.
1126 See Chapter 5 for more information.
1127 <p><dt><code>.dynstr</code><dd>
1128 This section holds strings needed for dynamic linking,
1129 most commonly the strings
1130 that represent the names associated with symbol table entries.
1131 See Chapter 5 for more information.
1132 <p><dt><code>.dynsym</code><dd>
1133 This section holds the dynamic linking symbol table,
1134 as described in
1135 <a href=ch4.symtab.html>``Symbol Table''</a>.
1136 See Chapter 5 for more information.
1137 <p><dt><code>.fini</code><dd>
1138 This section holds executable instructions that contribute
1139 to the process termination code.
1140 That is, when a program exits normally, the system arranges
1141 to execute the code in this section.
1142 <p><dt><code>.fini_array</code><dd>
1143 This section holds an array of function pointers that contributes
1144 to a single termination array for the executable or shared
1145 object containing the section.  
1146 <p><dt><code>.got</code><dd>
1147 This section holds the global offset table.
1148 See ``Coding Examples'' in Chapter 3, ``Special Sections'' in
1149 Chapter 4, and ``Global Offset Table'' in Chapter 5 of the 
1150 processor supplement for more information.
1151 <p><dt><code>.hash</code><dd>
1152 This section holds a symbol hash table.
1153 See 
1154 <a href=ch5.dynamic.html#hash>``Hash Table''</a>
1155 in Chapter 5 for more information.
1156 <p><dt><code>.init</code><dd>
1157 This section holds executable instructions that contribute
1158 to the process initialization code.
1159 When a program starts to run, the system arranges
1160 to execute the code in this section before calling the
1161 main program entry point (called <code>main</code> for C programs).
1162 <p><dt><code>.init_array</code><dd>
1163 This section holds an array of function pointers that contributes
1164 to a single initialization array for the executable or shared
1165 object containing the section.
1166 <p><dt><code>.interp</code><dd>
1167 This section holds the path name of a program interpreter.
1168 If the file has a loadable segment that includes
1169 relocation, the sections' attributes will include the
1170 <code>SHF_ALLOC</code> bit; otherwise, that bit will be off.
1171 See Chapter 5 for more information.
1172 <p><dt><code>.line</code><dd>
1173 This section holds line number information for symbolic
1174 debugging, which describes
1175 the correspondence between the source program and the
1176 machine code.
1177 The contents are unspecified.
1178 <p><dt><code>.note</code><dd>
1179 This section holds information in the format that
1180 <a href=ch5.pheader.html#note_section>``Note Section''</a>.
1181 in Chapter 5 describes.
1182 <p><dt><code>.plt</code><dd>
1183 This section holds the procedure linkage table.
1184 See ``Special Sections'' in Chapter 4 and ``Procedure Linkage
1185 Table'' in Chapter 5 of the processor supplement for more
1186 information.
1187 <p><dt><code>.preinit_array</code><dd>
1188 This section holds an array of function pointers that contributes
1189 to a single pre-initialization array for the executable or shared
1190 object containing the section.
1191 <p><dt><code>.rel</code><i>name</i>&nbsp;and&nbsp;<code>.rela</code><i>name</i><dd>
1192 These sections hold relocation information, as described in
1193 <a href=ch4.reloc.html>``Relocation''</a>.
1194 If the file has a loadable segment that includes
1195 relocation, the sections' attributes will include the
1196 <code>SHF_ALLOC</code> bit; otherwise, that bit will be off.
1197 Conventionally, <i>name</i>
1198 is supplied by the section to which the relocations apply.
1199 Thus a relocation section for <code>.text</code>
1200 normally would have the name <code>.rel.text</code> or <code>.rela.text</code>.
1201 <p><dt><code>.rodata</code>&nbsp;and&nbsp;<code>.rodata1</code><dd>
1202 These sections hold read-only data that
1203 typically contribute to a non-writable segment
1204 in the process image.
1205 See 
1206 <a href=ch5.pheader.html>``Program Header''</a>
1207 in Chapter 5 for more information.
1208 <p><dt><code>.shstrtab</code><dd>
1209 This section holds section names.
1210 <p><dt><code>.strtab</code><dd>
1211 This section holds strings, most commonly the strings
1212 that represent the names associated with symbol table entries.
1213 If the file has a loadable segment that includes the
1214 symbol string table, the section's attributes will include the
1215 <code>SHF_ALLOC</code>
1216 bit; otherwise, that bit will be off.
1217 <p><dt><code>.symtab</code><dd>
1218 This section holds a symbol table, as 
1219 <a href=ch4.symtab.html>``Symbol Table''</a>.
1220 in this chapter describes.
1221 If the file has a loadable segment that includes the
1222 symbol table, the section's attributes will include the
1223 <code>SHF_ALLOC</code> bit; otherwise, that bit will be off.
1224 <p><dt><code>.symtab_shndx</code><dd>
1225 This section holds the special symbol table section index
1226 array, as described above.  The section's attributes will include
1227 the <code>SHF_ALLOC</code> bit if the associated symbol table
1228 section does; otherwise that bit will be off.
1229 <a name=tbss></a>
1230 <p><dt><code>.tbss</code><dd>
1231 This section holds uninitialized <i>thread-local data</i> that contribute
1232 to the program's memory image.
1233 By definition,
1234 the system initializes the data with zeros
1235 when the data is instantiated for each new execution flow.
1236 The section occupies no file space, as indicated by the section type,
1237 <code>SHT_NOBITS</code>.
1238 Implementations need not support thread-local storage.
1239 <a name=tdata></a>
1240 <p><dt><code>.tdata</code><dd>
1241 This section holds initialized <i>thread-local data</i> that contributes
1242 to the program's memory image.
1243 A copy of its contents is instantiated by the system
1244 for each new execution flow.
1245 Implementations need not support thread-local storage.
1246 <p><dt><code>.text</code><dd>
1247 This section holds the ``text,'' or executable
1248 instructions, of a program.
1249 </dl>
1250 <p>
1251 Section names with a dot (<code>.</code>) prefix
1252 are reserved for the system,
1253 although applications may use these sections
1254 if their existing meanings are satisfactory.
1255 Applications may use names without the prefix to
1256 avoid conflicts with system sections.
1257 The object file format lets one define sections not
1258 shown in the previous list.
1259 An object file may have more than one section
1260 with the same name.
1261 <p>
1262 Section names reserved for a processor architecture
1263 are formed by placing an abbreviation of the architecture
1264 name ahead of the section name.
1265 The name should be taken from the
1266 architecture names used for <code>e_machine</code>.
1267 For instance <code>.</code>FOO<code>.psect</code> is the <code>psect</code>
1268 section defined by the FOO architecture.
1269 Existing extensions are called by their historical names.
1270 <p>
1271 <table>
1272 <caption><b>Pre-existing Extensions</b></caption>
1273 <tr>
1274 <td><code>.sdata</code></td>
1275 <td><code>.tdesc</code></td>
1276 </tr>
1277 <tr>
1278 <td><code>.sbss</code></td>
1279 <td><code>.lit4</code></td>
1280 </tr>
1281 <tr>
1282 <td><code>.lit8</code></td>
1283 <td><code>.reginfo</code></td>
1284 </tr>
1285 <tr>
1286 <td><code>.gptab</code></td>
1287 <td><code>.liblist</code></td>
1288 </tr>
1289 <tr>
1290 <td><code>.conflict</code></td>
1291 </tr>
1292 </table>
1293 <hr>
1294 <img src=warning.gif alt="NOTE:">
1295 For information on processor-specific sections,
1296 see the ABI supplement for the desired processor.
1297 <hr>
1298 <a href=ch4.eheader.html><img src=previous.gif alt="Previous"></a>
1299 <a href=contents.html><img src=contents.gif alt="Contents"></a>
1300 <a href=ch4.strtab.html><img src=next.gif alt="Next"></a>
1301 <hr>
1302 <i>
1303 <small>
1304 &#169; 1997, 1998, 1999, 2000, 2001 The Santa Cruz Operation, Inc.  All rights reserved.
1305 </small>
1306 </i>
1307 </html>