CHAPTER 5: LINKER

5.5 Linker Command File

To simplify the keystroke in the command line at the time of start up, execute the link processing through the linker by inputting a linker command file (.cm) that holds the necessary specifications (any options and file names) described.

Sample linker command file

-e

;

Generate

error file

-g

;

Add debug information

-code 0x0100

;

Fix CODE

section start address

-rcode test2.o = 0x0110 ;

Fix CODE

section start position of test2.o

-data 0x8000

;

Fix DATA

section start address

-bss 0x00e0

;

Fix BSS

section start address

-defsym IO = 0xFF00

;

Set global symbol

-o test.abs

;

Specify

output file name

test1.o

;

Specify

input file 1

test2.o

;

Specify

input file 2

 

 

 

 

Create the linker command file with the following rules:

File format

The linker command file is a general text format as shown above. ".cm" should be used for the file name extension.

Option description

All options should begin with a hyphen (-). Each individual option needs to be delineated with more than one space, tab, or line feed. For better visibility, it is recommended to describe each option in a separate line.

Notes: • A numeric value to specify an address should be described in the hexadecimal format (0xnnnn). Decimal and binary notations will not be accepted.

When an option that is only permitted in single setting is specified in a duplicated manner, the last entered option will be effective.

Example: -code 0x0000

-code 0x0100 ... -code 0x0100 is effective.

Input file specification

Describe the relocatable object file names at the end of the link command file. The mapping by linking takes place in described order, unless otherwise specified.

The extension (.o) of the relocatable object files can be omitted.

Comment

A comment can be described in the linker command file.

As in the source file, the character string from a semicolon (;) to the end of the line is regarded as a comment.

Blank line

A blank line carrying only blank characters and a line feed will be ignored. It need not be converted to a comment using a semicolon.

S5U1C63000A MANUAL

EPSON

95

(S1C63 FAMILY ASSEMBLER PACKAGE)