f78
ld Sections
text section
data section
bss section
absolute section
undefined section
Partial program #1:
These sections hold your program. as and ld treat them as separate but equal
sections. Anything you can say of one section is true for another. When the
program is running, however, it is customary for the text section to be
unalterable. The text section is often shared among processes: it contains instructions,
constants and the like. The data section of a running program is usually
alterable; for example, C variables would be stored in the data section.
This section contains zeroed bytes when your program begins running. It is
used to hold uninitialized variables or common storage. The length of each partial
program’s bss section is important, but because it starts out containing
zeroed bytes there is no need to store explicit zero bytes in the object file. The
bss section was invented to eliminate those explicit zeros from object files.
Address 0 of this section is always relocated to runtime address 0. This is useful if you want to refer to an address that
This section is a catch-all for address references to objects not in the preceding
sections.
text
| data
| bss
|
ttttt
| dddd
| 00
|
text
| data
| bss
|
TTT
| DDDD
| 000
|
| text
|
| data
2f1 TD> |
| bss
|
| TTT
| ttttt
|
| dddd
| DDDD
| 00000 ...
|
0
...0