Chapter 6 Using Linker

m

Output a map file

Functional description

The map file lists the addresses and sizes of all sections linked by the linker plus identifying information and values for local and global symbols.

For all programs, the addresses assigned to sections and symbols are not determined until linking. To create a final list file, reassemble the source file using the map file.

Rules of use

This option is specified with hyphen (-) option specification character, followed by the lower-case letter 'm'. The map file name will be the name of the first file specified in the link command with the extension .MAP. The map file will be output to the same directory as the directory where the executable format file is generated.

ld103 -m main.rf sub.rf

Default specification

A map file will not be output.

The default can be changed to output a map file by using customization. Refer to section 1.5, "User Customization".

Operation example

ld103 -o /user/obj/main.ex -m -T@CODE=80000000 prog1.rf prog2.rf

The above command line links two relocatable object files (prog1.rf and prog2.rf) located in the current directory, locates the resulting CODE section starting at the address 80000000 (hex.), and generates an executable file (main.ex) and map file (main.map) in the directory /user/obj.

ld103 -m -T_TEXT=80000000 -T_CONST=80005000 prog1.rf prog2.rf

The above command line links two relocatable object files (prog1.rf and prog2.rf) located in the current directory, locates the resulting _TEXT and _CONST sections starting at the addresses 80000000 (hex.) and 80005000 (hex.), respectively, and generates an executable file (m103.ex) and map file (m103.map) in the current directory.

90 Command Options

Page 102
Image 102
Panasonic MN1030 Output a map file, Ld103 -m main.rf sub.rf, Ld103 -m -TTEXT=80000000 -TCONST=80005000 prog1.rf prog2.rf