9 Using Mapfiles
This chapter describes with examples how to use the mapfile option.
•“Controlling Mapfiles with the
•“Changing Mapfiles with
•“Mapfile Example: Using
•“Default
•“Defining Syntax for Mapfile Directives” (page 195)
•“Defining Mapfile Segment Declarations” (page 196)
•“Internal Map Structure” (page 198)
•“Placement of Segments in an Executable” (page 198)
NOTE: In most cases, the linker produces a correct executable without the use of the mapfile option. The mapfile option is an advanced feature of the linker toolset intended for system programming use, not for application programming use. When using the mapfile option, you can easily create executable files that do not execute.
Controlling Mapfiles with the
The
ld
The ld command automatically maps sections from input object files onto output segments in executable files. The mapfile option allows you to change the default mapping provided by the linker. Use the
Changing Mapfiles with
The +nodefaultmap option used with
Mapfile Example: Using
cat mapfile
text = LOAD ?RX V0x1000; text : .rodata;
text : .PARISC.milli;
text : .dynamic;
text : .dynsym;
text : .dynstr;
text : .hash;
text : $PROGBITS ?AX;
text : .PARISC.unwind;
text : $UNWIND;
data = LOAD ?RW V0x4000000040001000; data : .opd;
data : .plt;
data : .dlt;
Controlling Mapfiles with the