• Keine Ergebnisse gefunden

EPSON.byte pseudo-instruction

12.5 Linker Commands

12.5.2 Linker Command List

The following 21 types of linker commands are provided for the lk33 (including the startup options that can be specified in a command line):

Table 12.5.2.1 Linker command list Function Specifies a command file. *1, *2 Outputs a link map file. *1 Outputs a symbol file. *1

Outputs debugging information. *1 Outputs an error file. *1

Sets the warning level.

Specifies a library search path.

Sets an output file name.

Sets a global symbol.

Deletes the duplicated global BSS area.

Sets a relocatable CODE section start address.

Sets a relocatable DATA section start address.

Sets a relocatable BSS section start address.

Sets a virtual/shared CODE section start address.

Sets a virtual/shared DATA section start address.

Sets a shared BSS section start address.

Creates section symbols.

Specifies an output section.

Outputs an srf33 file for the loader.

Enables linking .srf files.

Command

*2: Cannot be used in the command file.

The following explains each linker command. (For details on startup options, refer to Section 12.3.2.) Actual usage examples and link results are described in the next section.

-w command

Format: -w

Sample description: -w

Explanation: · If the -w command is specified, no warning is output for duplicate global labels in the BSS section.

Default: If this command is not specified, all warning messages are output.

-l command

Format: -l <Library search path>

Sample description: -l c:\cc33\lib

Explanation: · This command specifies the directory where libraries can be searched.

· At least one space or tab is required between -l and <Library search path>.

· Up to four library search paths can be specified. To specify multiple directories, specify the -l option for each directory.

Default: Unless this command is specified, only the current directory is searched.

A path name can be included in each written library file name.

-o command

Format: -o <Output file name>.srf Sample description: -o test.srf

Explanation: · This command specifies an output file name.

· At least one space or tab is required between -o and <Output file name>.

Default: Unless this command is specified, the linker uses the first file name that appears in the input object files written in the command file to generate the output file.

-defsym command

Format: -defsym <Symbol name> = <Value>

Sample description: -defsym BOOT = 0x0080000

Explanation: · Use this command to define the value of a global symbol.

· At least one space or tab is required between -defsym and <Symbol name>.

· The maximum number of symbols that can be defined by this command is 256.

Default: Unless this command is specified, no global symbol is set.

-d command

Format: -d

Sample description: -d

Explanation: · If multiple areas bearing the same global symbol name are set in the BSS section, this command deletes all but one area.

· The area that remains valid is the largest one which appears first among the input object file names specified.

Default: Unless this command is specified, the areas with invalid symbols are not deleted.

Note: A warning is issued if global symbols of the same name are defined.

This command is valid in only the BSS section; it is ignored in all other sections.

-code command

Format 1: -code <Address>

Format 2: -code <Section name>

Sample description: -code 0x0c00000 -code EXTERNAL_ROM

Explanation: · This command sets the start address of an area where a relocatable CODE section is located. The CODE sections in the files specified in format 3 or 4, and those in absolute object files are unaffected.

· <Section name> can only be specified when the section name and start address are set by the -section command.

· At least one space or tab is required between -code and <Address/Section name>.

· Specify a 4-byte boundary address for <Address>. If something else is specified, a warning is issued, in which case the two low-order bits of the specified address are ignored.

Default: Unless this command is specified, the CODE section begins from 0x0080000.

Format 3: -code <Address> {<File name> ... <File name> } Format 4: -code <Section name> {<File name> ... <File name> } Sample description: -code 0x0080100 {test1.o test2.o}

-code BLOCK2 {test1.o, test2.o}

Explanation: · This command locates the CODE sections of the relocatable object files specified in { } sequentially in the order the files are specified beginning with a specified address.

· When specifying multiple files, insert at least one space or tab between each <File name>.

CHAPTER 12: LINKER

EPSON

· Specify a 4-byte boundary address for <Address>. If something else is specified, a warning is issued, in which case the two low-order bits of the specified address are ignored.

Default: Unless this command is specified, the DATA section is located after the CODE section that is located at the highest address.

Format 3: -data <Address> {<File name> ... <File name> } Format 4: -data <Section name> {<File name> ... <File name> } Sample description: -data 0x0080100 {test1.o test2.o}

-data DATA1 {test1.o test2.o}

Explanation: · This command locates the DATA sections of the relocatable object files specified in { } sequentially in the order the files are specified beginning with a specified address.

· When specifying multiple files, insert at least one space or tab between each <File name>.

· Others are the same as in format 1 or 2.

-bss command

Format 1: -bss <Address>

Format 2: -bss <Section name>

Sample description: -bss 0x0000100 -bss VARIABLES

Explanation: · This command sets the start address of an area where a relocatable BSS section is located.

The BSS sections in the files specified in format 3 or 4 and those in absolute object files are unaffected.

· <Section name> can only be specified when the section name and start address are set by the -section command.

· At least one space or tab is required between -bss and <Address/Section name>.

· Specify a 4-byte boundary address for <Address>. If something else is specified, a warning is issued, in which case the two low-order bits of the specified address are ignored.

Default: Unless this command is specified, is the BSS section begins from 0x0000000.

Format 3: -bss <Address> {<File name> ... <File name> } Format 4: -bss <Section name> {<File name> ... <File name> } Sample description: -bss 0x0000100 {test1.o test2.o}

Explanation: · This command locates the BSS sections of the relocatable object files specified in { } sequentially in the order the files are specified beginning with the specified address.

· When specifying multiple files, insert at least one space or tab between each <File name>.

· Others are the same as in format 1 or 2.

-ucode command

Format 1: -ucode <Address>

Format 2: -ucode <Section name>

Sample description: -ucode 0x1000 -ucode CACHE

Explanation: · This command sets the start address of a virtual CODE section. The CODE sections of the relocatable object file for which format 1 and 2 settings of the -code command are applied are linked by resolving the symbol addresses in such a way that they can be located and executed beginning with the specified address. The row data positions are left intact as specified by -code, and are not modified. The CODE sections of absolute object files are unaffected. Specify this command when executing a program written in ROM after transferring it to RAM.

· <Section name> can only be specified when the section name is set by the -section command.

· At least one space or tab is required between -ucode and <Address/Section name>.

· Specify a 4-byte boundary address for <Address>. If something else is specified, a warning is issued, in which case the two low-order bits of the specified address is ignored.

Default: Unless this command is specified, no virtual CODE section is set.

Format 3: -ucode <Address> {<File name> ... <File name> } Format 4: -ucode <Section name> {<File name> ... <File name> } Sample description: -ucode 0x1000 {test1.o test2.o}

-ucode CACHE {test1.o test2.o}

Explanation: · This command sets the start address of a shared CODE section. The CODE sections of all relocatable object files specified in { } are linked by resolving the symbol addresses in such a way that they can be located and executed in the same area (the shared area that begins from a specified address or the specified start address of the shared section). This command should prove effective when one RAM area is shared by multiple specified object codes, and execution is repeated by sending the code to the RAM area via a time-multiplexed transfer.

· At least one space or tab is required between each <File name>.

· Others are the same as in format 1 or 2.

-udata command

Format 1: -udata <Address>

Format 2: -udata <Section name>

Sample description: -udata 0x1000 -udata INITDATA

Explanation: · This command sets the start address of a virtual DATA section. The DATA sections of the relocatable object file for which the format 1 and 2 settings of the -data command are applied are linked by resolving the symbol addresses in such a way that they can be located and executed beginning with the specified address. The row data positions are left intact as specified by -data and not modified. The DATA sections of absolute object files are unaffected. Specify this command when using data written in ROM (e.g., variables requiring initialization) after transferring it to RAM.

· <Section name> can only be specified when a section name is set by the -section command.

· At least one space or tab is required between -udata and <Address/Section name>.

· Specify a 4-byte boundary address for <Address>. If something else is specified, a warning is issued, in which case the two low-order bits of the specified address are ignored.

Default: Unless this command is specified, no virtual DATA section is set.

Format 3: -udata <Address> {<File name> ... <File name> } Format 4: -udata <Section name> {<File name> ... <File name> } Sample description: -udata 0x1000 {test1.o test2.o}

-udata INITDATA {test1.o test2.o}

Explanation: · This command sets the start address of a shared DATA section. The DATA sections of all relocatable object files specified in { } are linked by resolving the symbol addresses in such a way that they can be located and executed in the same area (the shared area that

CHAPTER 12: LINKER

EPSON

Explanation: · This command sets the start address of a shared BSS section. The BSS sections of all relocatable object files specified in { } are linked by resolving the symbol addresses in such a way that they can be located and used in the same area (the shared area that begins from the specified address or the specified start address of the shared section). The BSS sections of absolute object files are unaffected. This command should prove effective in cases in which one RAM area is shared by multiple specified object data, and the data is used separately via a time-multiplexed transfer.

· <Section name> can only be specified when the section name is set by the -section command.

· At least one space or tab is required between -ubss and <Address/Section name>.

· At least one space or tab is required between each <File name>.

· Specify a 4-byte boundary address for <Address>. If something else is specified, a warning is issued, in which case the two low-order bits of the specified address are ignored.

Default: Unless this command is specified, no shared BSS section is set.

-objsym command

Format: -objsym

Sample description: -objsym

Explanation: · This command creates three types of symbols indicating the start address, end address, and size of each section located in the input file (refer to Section 12.8). These symbols can be used in the source file when creating a routine for transfer to virtual or shared sections.

Default: Unless this command is specified, no symbol is created.

-section command

Format 1: -section <Section name>

Format 2: -section <Section name> = <Address>

Sample description: -section TMP

-section CACHE = 0x1000

Explanation: · This command defines a section name.

· Format 1 is used for virtual and shared sections, where an address following the last address of the default BSS area (specified by the -bss command) is the start address of the virtual or shared section. Format 2 defines a section name and its start address, which can be used to specify any section.

· At least one space or tab is required between -section and <Section name>.

· The size of an area is determined by setting a section specifying command, and three types of symbols are created indicating the start address, the end address after being located (at maximum use), and the size (refer to Section 12.8). These symbols can be used in the source file when creating a routine for transfer to virtual or shared sections.

-ld

Format: -ld

Sample description: -ld

Explanation: · Creates an srf33 file for the loader ld33 instead of a standard absolute object file. Refer to readme.txt (English) or readmeja.txt (Japanese) located in the "utility\ld33\" directory for the loader ld33.

Default: Unless this command is specified, a standard absolute object file is created.

Note: When creating this file, the -ucode, -udata and -ubss commands for specifying U sections cannot be used. Furthermore, 2-pass make optimization cannot be performed.

-inclink

Format: -inclink

Sample description: -inclink

Explanation: · Enables absolute object files (.srf) as link files. When this command is specified, .srf files can be linked similar to the absolute object files generated by the as33. However, absolute object files for the loader that are created with the -ld command cannot be linked.

Default: Unless this command is specified, ".srf" files cannot be linked