9763b5530d
git-svn-id: svn://svn.compuextreme.de/Viitor/V961/Viitor_cc65@4236 504e572c-2e33-0410-9681-be2bf7408885
240 lines
9.5 KiB
HTML
240 lines
9.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20">
|
|
<TITLE>ld65 Users Guide: Usage</TITLE>
|
|
<LINK HREF="ld65-3.html" REL=next>
|
|
<LINK HREF="ld65-1.html" REL=previous>
|
|
<LINK HREF="ld65.html#toc2" REL=contents>
|
|
</HEAD>
|
|
<BODY>
|
|
<A HREF="ld65-3.html">Next</A>
|
|
<A HREF="ld65-1.html">Previous</A>
|
|
<A HREF="ld65.html#toc2">Contents</A>
|
|
<HR>
|
|
<H2><A NAME="s2">2.</A> <A HREF="ld65.html#toc2">Usage</A></H2>
|
|
|
|
|
|
|
|
|
|
<H2><A NAME="ss2.1">2.1</A> <A HREF="ld65.html#toc2.1">Command line option overview</A>
|
|
</H2>
|
|
|
|
|
|
<P>The linker is called as follows:</P>
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
---------------------------------------------------------------------------
|
|
Usage: ld65 [options] module ...
|
|
Short options:
|
|
-( Start a library group
|
|
-) End a library group
|
|
-C name Use linker config file
|
|
-D sym=val Define a symbol
|
|
-L path Specify a library search path
|
|
-Ln name Create a VICE label file
|
|
-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
|
|
--dbgfile name Generate debug information
|
|
--define sym=val Define a symbol
|
|
--dump-config name Dump a builtin configuration
|
|
--end-group End a library group
|
|
--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
|
|
--start-group Start a library group
|
|
--target sys Set the target system
|
|
--version Print the linker version
|
|
---------------------------------------------------------------------------
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
</P>
|
|
|
|
|
|
<H2><A NAME="ss2.2">2.2</A> <A HREF="ld65.html#toc2.2">Command line options in detail</A>
|
|
</H2>
|
|
|
|
|
|
<P>Here is a description of all the command line options:</P>
|
|
<P>
|
|
<DL>
|
|
<P>
|
|
<A NAME="option--start-group"></A> </P>
|
|
<DT><B><CODE>-(, --start-group</CODE></B><DD><P>Start a library group. The libraries specified within a group are searched
|
|
multiple times to resolve crossreferences within the libraries. Normally,
|
|
crossreferences are only resolved within a library, that is the library is
|
|
searched multiple times. Libraries specified later on the command line
|
|
cannot reference otherwise unreferenced symbols in libraries specified
|
|
earlier, because the linker has already handled them. Library groups are
|
|
a solution for this problem, because the linker will search repeatedly
|
|
through all libraries specified in the group, until all possible open
|
|
symbol references have been satisfied.</P>
|
|
|
|
|
|
<DT><B><CODE>-), --end-group</CODE></B><DD><P>End a library group. See the explanation of the <CODE>
|
|
<A HREF="#option--start-group">--start-group</A></CODE> option.</P>
|
|
|
|
|
|
<DT><B><CODE>-h, --help</CODE></B><DD><P>Print the short option summary shown above.</P>
|
|
|
|
<P>
|
|
<A NAME="option-m"></A> </P>
|
|
<DT><B><CODE>-m name, --mapfile name</CODE></B><DD><P>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.</P>
|
|
|
|
<P>
|
|
<A NAME="option-o"></A> </P>
|
|
<DT><B><CODE>-o name</CODE></B><DD><P>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.</P>
|
|
|
|
<P>
|
|
<A NAME="option-t"></A> </P>
|
|
<DT><B><CODE>-t sys, --target sys</CODE></B><DD><P>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 <CODE>
|
|
<A HREF="#option-C">-C</A></CODE> option. The following target
|
|
systems are currently supported:</P>
|
|
<P>
|
|
<UL>
|
|
<LI>none</LI>
|
|
<LI>apple2</LI>
|
|
<LI>atari</LI>
|
|
<LI>atmos</LI>
|
|
<LI>c16 (works also for the c116 with memory up to 32K)</LI>
|
|
<LI>c64</LI>
|
|
<LI>c128</LI>
|
|
<LI>plus4</LI>
|
|
<LI>cbm510 (CBM-II series with 40 column video)</LI>
|
|
<LI>cbm610 (all CBM series-II computers with 80 column video)</LI>
|
|
<LI>pet (all CBM PET systems except the 2001)</LI>
|
|
<LI>geos</LI>
|
|
<LI>lunix</LI>
|
|
<LI>atmos</LI>
|
|
<LI>nes</LI>
|
|
</UL>
|
|
</P>
|
|
<P>There are a few more targets defined but neither of them is actually
|
|
supported.</P>
|
|
|
|
<P>
|
|
<A NAME="option-v"></A> </P>
|
|
<DT><B><CODE>-v, --verbose</CODE></B><DD><P>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.</P>
|
|
|
|
|
|
<DT><B><CODE>-vm</CODE></B><DD><P>Must be used in conjunction with <CODE>
|
|
<A HREF="#option-m">-m</A></CODE>
|
|
(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.</P>
|
|
|
|
<P>
|
|
<A NAME="option-C"></A> </P>
|
|
<DT><B><CODE>-C</CODE></B><DD><P>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 <CODE>
|
|
<A HREF="#option-t">-t</A></CODE>.</P>
|
|
|
|
<P>
|
|
<A NAME="option-D"></A> </P>
|
|
<DT><B><CODE>-D sym=value, --define sym=value</CODE></B><DD><P>This option allows to define an external symbol on the command line. Value
|
|
may start with a '$' sign or with <CODE>0x</CODE> for hexadecimal values,
|
|
otherwise a leading zero denotes octal values. See also the
|
|
<A HREF="ld65-5.html#SYMBOLS">SYMBOLS section</A> in the configuration file.</P>
|
|
|
|
<P>
|
|
<A NAME="option--lib-path"></A> </P>
|
|
<DT><B><CODE>-L path, --lib-path path</CODE></B><DD><P>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 <CODE>LD65_LIB</CODE> environment variable, and in the list of directories
|
|
specified using <CODE>--lib-path</CODE>.</P>
|
|
|
|
|
|
<DT><B><CODE>-Ln</CODE></B><DD><P>This option allows you to create a file that contains all global labels and
|
|
may be loaded into VICE emulator using the <CODE>ll</CODE> (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.</P>
|
|
|
|
<P>
|
|
<A NAME="option-S"></A> </P>
|
|
<DT><B><CODE>-S addr, --start-addr addr</CODE></B><DD><P>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.</P>
|
|
|
|
|
|
<DT><B><CODE>-V, --version</CODE></B><DD><P>This option print the version number of the linker. If you send any
|
|
suggestions or bugfixes, please include this number.</P>
|
|
|
|
<P>
|
|
<A NAME="option--cfg-path"></A> </P>
|
|
<DT><B><CODE>--cfg-path path</CODE></B><DD><P>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 <CODE>
|
|
<A HREF="#option-C">-C</A></CODE> option that has no path in
|
|
its name is searched in the current directory, in the directory given in the
|
|
<CODE>LD65_CFG</CODE> environment variable, and in the list of directories specified
|
|
using <CODE>--cfg-path</CODE>.</P>
|
|
|
|
<P>
|
|
<A NAME="option--dbgfile"></A> </P>
|
|
<DT><B><CODE>--dbgfile name</CODE></B><DD><P>Specify an output file for debug information. Available information will be
|
|
written to this file. Using the <CODE>-g</CODE> option for the compiler and assembler
|
|
will increase the amount of information available. Please note that debug
|
|
information generation is currently being developed, so the format of the
|
|
file and it's contents are subject to change without further notice.</P>
|
|
|
|
|
|
<DT><B><CODE>--lib file</CODE></B><DD><P>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.</P>
|
|
|
|
|
|
<DT><B><CODE>--obj file</CODE></B><DD><P>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.</P>
|
|
|
|
<P>
|
|
<A NAME="option--obj-path"></A> </P>
|
|
<DT><B><CODE>--obj-path path</CODE></B><DD><P>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 <CODE>LD65_OBJ</CODE> environment variable,
|
|
and in the list of directories specified using <CODE>--obj-path</CODE>.</P>
|
|
|
|
</DL>
|
|
</P>
|
|
|
|
|
|
|
|
<HR>
|
|
<A HREF="ld65-3.html">Next</A>
|
|
<A HREF="ld65-1.html">Previous</A>
|
|
<A HREF="ld65.html#toc2">Contents</A>
|
|
</BODY>
|
|
</HTML>
|