The linker is called as follows:
---------------------------------------------------------------------------
Usage: ld65 [options] module ...
Short options:
-C name Use linker config file
-L path Specify a library search path
-Ln name Create a VICE label file
-Lp Mark write protected segments as such (VICE)
-S addr Set the default start address
-V Print the linker version
-h Help (this text)
-m name Create a map file
-o name Name the default output file
-t sys Set the target system
-v Verbose mode
-vm Verbose map file
Long options:
--cfg-path path Specify a config file search path
--config name Use linker config file
--dump-config name Dump a builtin configuration
--help Help (this text)
--lib file Link this library
--lib-path path Specify a library search path
--mapfile name Create a map file
--module-id id Specify a module id
--obj file Link this object file
--obj-path path Specify an object file search path
--start-addr addr Set the default start address
--target sys Set the target system
--version Print the linker version
---------------------------------------------------------------------------
Here is a description of all the command line options:
-h, --help
Print the short option summary shown above.
-m name, --mapfile name
This option (which needs an argument that will used as a filename for the generated map file) will cause the linker to generate a map file. The map file does contain a detailed overview over the modules used, the sizes for the different segments, and a table containing exported symbols.
-o name
The -o switch is used to give the name of the default output file. Depending on your output configuration, this name may NOT be used as name for the output file. However, for the builtin configurations, this name is used for the output file name.
-t sys, --target sys
The argument for the -t switch is the name of the target system. Since this
switch will activate a builtin configuration, it may not be used together
with the
-C
option. The following target
systems are currently supported:
There are a few more targets defined but neither of them is actually supported.
-v, --verbose
Using the -v option, you may enable more output that may help you to locate problems. If an undefined symbol is encountered, -v causes the linker to print a detailed list of the references (that is, source file and line) for this symbol.
-vm
Must be used in conjunction with
-m
(generate map file). Normally the map file will not include empty segments
and sections, or unreferenced symbols. Using this option, you can force the
linker to include all this information into the map file.
-C
This gives the name of an output config file to use. See section 4 for more
information about config files. -C may not be used together with
-t
.
-L path, --lib-path path
Specify a library search path. This option may be used more than once. It
adds a directory to the search path for library files. Libraries specified
without a path are searched in current directory, in the directory given in
the LD65_LIB
environment variable, and in the list of directories
specified using --lib-path
.
-Ln
This option allows you to create a file that contains all global labels and
may be loaded into VICE emulator using the ll
(load label) command. You
may use this to debug your code with VICE. Note: Older versions had some
bugs in the label code. If you have problems, please get the latest VICE
version.
-Lp
Deprecated option.
-S addr, --start-addr addr
Using -S you may define the default starting address. If and how this address is used depends on the config file in use. For the builtin configurations, only the "none" system honors an explicit start address, all other builtin config provide their own.
-V, --version
This option print the version number of the linker. If you send any suggestions or bugfixes, please include this number.
--cfg-path path
Specify a config file search path. This option may be used more than once.
It adds a directory to the search path for config files. A config file given
with the
-C
option that has no path in
its name is searched in the current directory, in the directory given in the
LD65_CFG
environment variable, and in the list of directories specified
using --cfg-path
.
--lib file
Links a library to the output. Use this command line option instead of just naming the library file, if the linker is not able to determine the file type because of an unusual extension.
--obj file
Links an object file to the output. Use this command line option instead of just naming the object file, if the linker is not able to determine the file type because of an unusual extension.
--obj-path path
Specify an object file search path. This option may be used more than once.
It adds a directory to the search path for object files. An object file
passed to the linker that has no path in its name is searched in current
directory, in the directory given in the LD65_OBJ
environment variable,
and in the list of directories specified using --obj-path
.