| |||
| Home > RealView Debugger Commands > Alphabetical command reference > LOAD | |||
The LOAD command loads the specified executable file onto the target.
LOAD [/A] [/C]
[/NI] [{/NP|/SP}] [/NS] [/PD] [/R] absolute_filename[,root] [;section [,section]...]
[;arg1 ...]
[&base_address]
where:
/AThis loads and appends another executable image
without deleting any existing one. If the new image file overlaps
the addresses of the existing object modules, the load terminates
and displays an error message. If you want to replace the current
image with a new one, use /R.
This option might be the default option if you are running an operating system extension to RealView Debugger. For more information, consult the manual provided with the extension.
/CConverts all symbols to lowercase as they are read by the absolute file reader.
/NILoads
only the symbol table. Overlap of addresses is checked if /A is
also used. Does not load the program image code or the data.
/NPPrevents the command changing the value of the PC.
/NSPrevents
the command loading debug information into the symbol table. Only
the program image is loaded. No check for overlapping addresses
is made. The /NS option can be used to reload
the current program image without affecting the symbol table.
/PDPop dialog. Display a dialog for errors and warnings, rather than dumping them to the log.
/RReplaces the existing program with the program being loaded.
/SPSets
the PC to the start address specified in the object module. This
is the default behavior when symbols are loaded, the image file
specifies an entry address and the /A flag is
not also specified.
absolute_filenameSpecifies the name of the absolute object file to be loaded. Quotation marks are optional, but see Rules for specifying filenames for details on how to specify filenames that include a path. Also, see Rules.
rootSpecifies the root associated with the symbols in the program being loaded. The default root is the filename without an extension. See Rules for details on how to specify a root.
sectionLists sections to load when an image is being loaded. The default is to load all sections. This option is commonly used to reload the initialized data area when starting a program.
The section names that are available for a specific image can be listed using the ARM development tools command fromelf or the GNU development tools command objdump. See Rules for details on how to specify sections.
argsSpecifies an optional, space-separated, list of arguments to the image.
You can also specify arguments using the ARGUMENTS command. For example, you can might want to modify the arguments without unloading the image.
The case of arguments is preserved. See Rules for details on how to specify arguments.
base_addressSpecifies an address offset to be added to all sections when computing the load addresses.
For this option to work correctly with position-independent code and data, your program must have been compiled with Position-Independent Code (PIC) and Position-Independent Data (PID).
For TrustZone® applications, be aware of the following:
An image is loaded into the Secure world by default.
To load an image into the Normal world, then prefix
the address with &N:. For example:
the following command loads an image at the image entry point:
load ‘C:\myproject\myimage.axf’ &N:0
the following command loads a position-independent image:
load ‘C:\myproject\myimage.axf’ &N:0x1000
You can also prefix the address with &S:,
if you want to explicitly identify a Secure world address.
The LOAD command loads the specified executable file into the debug target. The file specified must be a format supported by the RealView Debugger.
To reset the initialized values of program variables after entering a RESET or a RESTART command, you must reload your program using the LOAD command. The RELOAD command checks the file date to determine whether program symbols have changed and therefore whether they must be reloaded.
If a load is performed that includes the symbol table, any breakpoints or macros referring to symbols in the previous root are invalidated.
The LOAD command runs synchronously.
Follow these rules when using LOAD:
, absolute_filename, root,
and section must all be
placed in the same set of quotes. For example, on Windows:args
load /pd/r 'c:\source\demofile.axf ;ER_RO,ER_ZI ;12345' &0x8A00
If you want to specify arguments, but not a section, you must specify an empty section. All sections are loaded in this case. For example:
load /pd/r 'c:\source\myfile.axf;;arg1 arg2 arg3'
Where an argument includes spaces, additional quotes must be used. Use single quotes around arguments if the outer quotes are double quotes. Use double quotes around arguments if outer quotes are single quotes. For example:
load /pd/r "myimage.axf ;;12345 'Argument Two'" &0x8A00
must
be placed outside the quotes, and must be the last parameter specified.base_address
The following examples show how to use LOAD:
load 'c:\source\myfile.axf'Load the executable file myfile.axf to
the target.
load /ni/sp 'c:\source\rtos.axf'Load the symbol table for an image rtos.axf that
is also in target ROM, setting the PC to the program start address
so that a subsequent GO runs the program.
load /np 'c:\source\mp3.axf'Load the executable library mp3.axf onto
the target so that the preloaded executable can use it. The PC is
not modified. Symbol table entries in mp3.axf are
added to the existing symbol table.
Ensure that executables you load in this way occupy distinct memory regions. No relocation is performed by RealView Debugger unless you specify a base offset.
load /pd/r 'c:\source\demofile.axf
;ER_RO,ER_ZI' &0x8A00Load the
executable file demofile.axf to the default
target. Specify an offset added to all sections to compute the load
addresses. Load only the specified sections ER_RO and ER_ZI.
load /pd/r 'c:\source\myfile.axf;;arg1
arg2 arg3'Load the executable file myfile.axf to
the default target using an arguments list. An empty section list
is given so all sections are loaded.