Chapter 3 Introduction to Operation
Basic Operation of Assembler and Linker 27
Link
Link the two relocatable object files to generate an executable format file. A map file will be generated
along with the executable format file at this time.
ld103 -m -T_CODE=40000000 program1.rf program2.rf
m option Option to output map file.
T option Option to specify section address.
The above command line links two relocatable object files (program1.rf and program2.rf) and creates
an executable file (m103.ex) and a map file (m103.map) in the current directory.
Supplemental Explanation:
The -o option is also available for specifying a different output file name and
directory for the executable file. Omitting this option results in the use of the
default name m103 and the extension .ex. There is no option for specifying
the name of the map file. It uses the same default name as the executable
file, m103, and the extension .map. The output directory is the same as that
used for the executable file.
Generate final list files
After link processing is complete, generate the final list files using the map file (m103.map).
as103 -l -a m103.map program1.asm
as103 -l -a m103.map program2.asm
l option Option to output a list file.
a option Option to read a map file. Specify the map file name after it.
This operation will generate the final list files (program1.lst and program2.lst) in the current directory.
With the above operations, you can generate an executable format file and final list files in the current
directory.
You must generate the final list files using the map file after linking. This is because linking determines
the start addresses of sections following the T option for files in section address format. In addition,
there may be addresses unresolved until after link processing due to forward references, optimization,
etc. (Refer to chapter 4, "Optimization".)