Справочник Пользователя для Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1
Модели
SW006021-1
Linker
2012 Microchip Technology Inc.
DS52053B-page 287
A typical map file may begin something like the following. This example has been cut
down for clarity.
down for clarity.
--edf=/home/jeff/Microchip/XC8/1.00/dat/en_msgs.txt -cs -h+main.sym -z \
-Q16F946 -ol.obj -Mmain.map -ver=XC8 -ACONST=00h-0FFhx32 \
-ACODE=00h-07FFhx4 -ASTRCODE=00h-01FFFh -AENTRY=00h-0FFhx32 \
-ASTRING=00h-0FFhx32 -ACOMMON=070h-07Fh -ABANK0=020h-06Fh \
-ABANK1=0A0h-0EFh -ABANK2=0120h-016Fh -ABANK3=01A0h-01EFh \
-ARAM=020h-06Fh,0A0h-0EFh,0120h-016Fh,01A0h-01EFh \
-AABS1=020h-07Fh,0A0h-0EFh,0120h-016Fh,01A0h-01EFh -ASFR0=00h-01Fh \
-ASFR1=080h-09Fh -ASFR2=0100h-011Fh -ASFR3=0180h-019Fh \
-preset_vec=00h,intentry,init,end_init -ppowerup=CODE -pfunctab=CODE \
-ACONFIG=02007h-02007h -pconfig=CONFIG -DCONFIG=2 -AIDLOC=02000h-02003h \
-pidloc=IDLOC -DIDLOC=2 -AEEDATA=00h-0FFh/02100h -peeprom_data=EEDATA \
-DEEDATA=2 -DCODE=2 -DSTRCODE=2 -DSTRING=2 -DCONST=2 -DENTRY=2 -k \
startup.obj main.obj
Object code version is 3.10
Machine type is 16F946
The Linker command line shows all the command-line options and files that were
passed to the linker for the last build. Remember, these are linker options and not
command-line driver options.
passed to the linker for the last build. Remember, these are linker options and not
command-line driver options.
The linker options are necessarily complex. Fortunately, they rarely need adjusting
from their default settings. They are formed by the command-line driver, xc8, based on
the selected target device and the specified driver options. You can often confirm that
driver options were valid by looking at the linker options in the map file. For example, if
you ask the driver to reserve an area of memory, you should see a change in the linker
options used.
from their default settings. They are formed by the command-line driver, xc8, based on
the selected target device and the specified driver options. You can often confirm that
driver options were valid by looking at the linker options in the map file. For example, if
you ask the driver to reserve an area of memory, you should see a change in the linker
options used.
If the default linker options must be changed, this can be done indirectly through the
driver using the driver -L- option, see Section 4.8.7 “-L-: Adjust Linker Options
Directly”. If you use this option, always confirm the change appears correctly in the
map file.
driver using the driver -L- option, see Section 4.8.7 “-L-: Adjust Linker Options
Directly”. If you use this option, always confirm the change appears correctly in the
map file.
7.4.2.2
PSECT INFORMATION LISTED BY MODULE
The next section in the map file lists those modules that made a contribution to the out-
put, and information regarding the psects these modules defined. See
Section 5.15.1 “Program Sections” for an introductory explanation of psects.
put, and information regarding the psects these modules defined. See
Section 5.15.1 “Program Sections” for an introductory explanation of psects.
This section is heralded by the line that contains the headings:
Name Link Load Length Selector Space Scale
Under this on the far left is a list of object files. These object files include both files gen-
erated from source modules and those that were extracted from object library files
(.lib extension). In the latter case, the name of the library file is printed before the
object file list. Note that since the code generator combines all C source files (and
p-code libraries), there will only be one object file representing the entire C part of the
program. The object file corresponding to the runtime startup code is normally present
in this list.
erated from source modules and those that were extracted from object library files
(.lib extension). In the latter case, the name of the library file is printed before the
object file list. Note that since the code generator combines all C source files (and
p-code libraries), there will only be one object file representing the entire C part of the
program. The object file corresponding to the runtime startup code is normally present
in this list.
The information in this section of the map file can be used to confirm that a module is
making a contribution to the output file and to determine the exact psects that each
module defines.
making a contribution to the output file and to determine the exact psects that each
module defines.
Shown are all the psects (under the Name column) that were linked into the program
from each object file, and information about that psect.
from each object file, and information about that psect.
The linker deals with two kinds of addresses: link and load. Generally speaking the link
address of a psect is the address by which it will be accessed at run time.
address of a psect is the address by which it will be accessed at run time.