XGC User's Guide: Using the Assembler Linker and Utilities | ||
---|---|---|
Prev | Chapter 5. Sections and Relocation | Next |
The linker deals with just four kinds of sections, summarized below.
These sections hold your program. the assembler and the linker treat them as separate but equal sections. Anything you can say of one section is true another.
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 the linker must not change when relocating. In this sense we speak of absolute addresses being un-relocatable: they do not change during relocation.
This section is a catch-all for address references to objects not in the preceding sections.
An idealized example of three relocatable sections follows. The example uses the traditional section names ".text" and ".data". Memory addresses are on the horizontal axis.