beautypg.com

Zilog Z8F0130 User Manual

Page 277

background image

UM013037-1212

Sample Linker Command File

Zilog Developer Studio II – Z8 Encore!

User Manual

253

ifying them in the

Additional Linker Directives

dialog box (see the

Additional Directives

section on page 96). Alternatively, you can define your own linker command file by
selecting the

Use Existing

button (see the

Use Existing

section on page 97).

The most important of the linker commands and options in the default linker command file
are now discussed individually, in the order in which they are typically found in the linker
command file:

-FORMAT=OMF695, INTEL32

-map -maxhexlen=64 -quiet -warnoverlap -NOxref -unresolved=fatal

-sort NAME=ascending -warn –debug -

NOigcase

In this command, the linker output file format is selected to be OMF695, which is based
on the IEEE 695 object file format, and INTEL32, which is the Intel Hex 32 format. This
setting is generated from options selected in the

Output

page (see the

Linker: Output Page

section on page 107). The

–map

(Generate Map File),

-sort

(Sort Symbols By Address),

and

-maxhexlen

(Maximum Bytes per Hex File Line) settings are also generated from

options selected in the

Output

page.

The

–warnoverlap

(Warn on Segment Overlap) and

–unresolved

(Treat Undefined

Symbols as Fatal) options are generated from options selected in the Warnings page (see
the

Linker: Warnings Page

section on page 106).

The other options shown here are all generated from the settings selected in the

General

page of the

Project Settings

dialog box (see the

General Page

section on page 69).

RANGE ROM $0 : $FFFF

RANGE RDATA $20 : $FF

RANGE EDATA $100 : $EFF

The ranges for the three address spaces are defined here. These ranges are taken from the
settings in Address Spaces page (see the

Linker: Address Spaces Page

section on page

103).

CHANGE NEAR_TEXT=NEAR_DATA

CHANGE FAR_TEXT=FAR_DATA

The NEAR_TEXT and FAR_TEXT segments are renamed to NEAR_DATA and
FAR_DATA segments, respectively, by the preceding commands. The NEAR_TEXT and
FAR_TEXT segments contain constant strings in RData and EData, respectively. This
reduces the number of initialized segments from four to two, and the C start-up then only
must initialize two segments.

ORDER FAR_BSS, FAR_DATA

ORDER NEAR_BSS,NEAR_DATA

These ORDER commands specify the link order of these segments. The FAR_BSS seg-
ment is placed at lower addresses with the FAR_DATA segment immediately following it
in the EData space. Similarly, NEAR_DATA follows after NEAR_BSS in the RData
space.