Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 Manual Do Utilizador
Códigos do produto
SW006021-1
MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 280
2012 Microchip Technology Inc.
7.2.7
-F
Normally the linker will produce an object file that contains both program code and data
bytes, and symbol information. Sometimes it is desired to produce a symbol-only object
file that can be used again in a subsequent linker run to supply symbol values. The -F
option will suppress data and code bytes from the output file, leaving only the symbol
records.
bytes, and symbol information. Sometimes it is desired to produce a symbol-only object
file that can be used again in a subsequent linker run to supply symbol values. The -F
option will suppress data and code bytes from the output file, leaving only the symbol
records.
This option can be used when part of one project (i.e., a separate build) is to be shared
with other, as might be the case with a bootloader and application. The files for one
project are compiled using this linker option to produce a symbol-only object file; this is
then linked with the files for the other project.
with other, as might be the case with a bootloader and application. The files for one
project are compiled using this linker option to produce a symbol-only object file; this is
then linked with the files for the other project.
7.2.8
-Gspec
When linking programs using segmented, or bank-switched psects, there are two ways
the linker can assign segment addresses, or selectors, to each segment. A segment is
defined as a contiguous group of psects where each psect in sequence has both its link
and load address concatenated with the previous psect in the group. The segment
address or selector for the segment is the value derived when a segment type
relocation is processed by the linker.
the linker can assign segment addresses, or selectors, to each segment. A segment is
defined as a contiguous group of psects where each psect in sequence has both its link
and load address concatenated with the previous psect in the group. The segment
address or selector for the segment is the value derived when a segment type
relocation is processed by the linker.
By default the segment selector will be generated by dividing the base load address of
the segment by the relocation quantum of the segment, which is based on the reloc=
flag value given to psects at the assembler level, see Section 6.4.9.3.11 “Reloc”. The
-G
the segment by the relocation quantum of the segment, which is based on the reloc=
flag value given to psects at the assembler level, see Section 6.4.9.3.11 “Reloc”. The
-G
option allows an alternate method for calculating the segment selector. The
argument to -G is a string similar to:
A /10h-4h
where A represents the load address of the segment and / represents division. This
means “Take the load address of the psect, divide by 10 HEX, then subtract 4”. This
form can be modified by substituting N for A, * for / (to represent multiplication), and
adding rather than subtracting a constant. The token N is replaced by the ordinal
number of the segment, which is allocated by the linker. For example:
means “Take the load address of the psect, divide by 10 HEX, then subtract 4”. This
form can be modified by substituting N for A, * for / (to represent multiplication), and
adding rather than subtracting a constant. The token N is replaced by the ordinal
number of the segment, which is allocated by the linker. For example:
N*8+4
means “take the segment number, multiply by 8 then add 4”. The result is the segment
selector. This particular example would allocate segment selectors in the sequence 4,
12, 20, ... for the number of segments defined.
selector. This particular example would allocate segment selectors in the sequence 4,
12, 20, ... for the number of segments defined.
The selector of each psect is shown in the map file. See Section 7.4.2.2 “Psect
Information Listed by Module”.
Information Listed by Module”.
7.2.9
-Hsymfile
This option will instruct the linker to generate a symbol file. The optional argument
symfile
symfile
specifies the name of the file to receive the data. The default file name is
l.sym
.
7.2.10
-H+symfile
This option will instruct the linker to generate an enhanced symbol file, which provides,
in addition to the standard symbol file, class names associated with each symbol and
a segments section which lists each class name and the range of memory it occupies.
This format is recommended if the code is to be run in conjunction with a debugger. The
optional argument symfile specifies a file to receive the symbol file. The default file
name is l.sym.
in addition to the standard symbol file, class names associated with each symbol and
a segments section which lists each class name and the range of memory it occupies.
This format is recommended if the code is to be run in conjunction with a debugger. The
optional argument symfile specifies a file to receive the symbol file. The default file
name is l.sym.