Section Layout

The linker lists information of all the objects within a section in a section layout. Sample .text section layout shows a sample .text section layout.

Listing 1. Sample .text section layout
.text section layout
     Starting        Virtual  File
     address  Size   address  offset
     --------------------------------- 
     00000084  000030  fffc1964  00001ce4  1 .text      
     00000084  00000c  fffc1964  00001ce4  4 __init_user        __ppc_eabi_init.o
     00000090  000020  fffc1970  00001cf0  4 exit       __ppc_eabi_init.o 
     000000b0  000004  fffc1990  00001d10  4 _ExitProcess       __ppc_eabi_init.o 
     ...
     UNUSED  000030 ........ ........    __copy Runtime.PPCEABI.E2.UC.a CPlusLibPPC.o
     UNUSED  000084 ........ ........    __init_arr Runtime.PPCEABI.E2.UC.a CPlusLibPPC.o

     ...

The first line of a section layout specifies the name of a section. Starting from the 5th line (the line after the dotted line separator), objects within section are listed with the following information:

In the sample above, note that the 5th line has a section name and that its Starting address, Virtual address and File offset values are similar to __init_user values. The 5th line is the section symbol for the objects that follow it. Its Size column is the total size of the section in the executable file (after dead stripping) and its alignment (column 5) is 1.

Although Sample .text section layout is from a normal .o file, if this project had an input file which was a partially linked file, then you would see a section symbol between each merged section from each input file used to create the partially linked file. For example, if plf.o is a partially linked file, and it is composed of a.o and b.o and each of those files had a .text section, then plf.o would have one .text section but two .text section symbols. The .text content from a.o would follow the first section symbol and the content from b.o would follow the second section symbol.