📄 ld65-2.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: -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 fileLong 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---------------------------------------------------------------------------</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><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 forthe generated map file) will cause the linker to generate a map file.The map file does contain a detailed overview over the modules used, thesizes for the different segments, and a table containing exportedsymbols.</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 asname for the output file. However, for the builtin configurations, thisname 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 thisswitch will activate a builtin configuration, it may not be used togetherwith the <CODE><A HREF="#option-C">-C</A></CODE> option. The following targetsystems 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 actuallysupported.</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 tolocate problems. If an undefined symbol is encountered, -v causes thelinker to print a detailed list of the references (that is, source fileand 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 segmentsand sections, or unreferenced symbols. Using this option, you can force thelinker 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 moreinformation about config files. -C may not be used together with <CODE><A HREF="#option-t">-t</A></CODE>.</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. Itadds a directory to the search path for library files. Libraries specifiedwithout a path are searched in current directory, in the directory given inthe <CODE>LD65_LIB</CODE> environment variable, and in the list of directoriesspecified 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 andmay be loaded into VICE emulator using the <CODE>ll</CODE> (load label) command. Youmay use this to debug your code with VICE. Note: Older versions had somebugs in the label code. If you have problems, please get the latest VICEversion.</P><DT><B><CODE>-Lp</CODE></B><DD><P>Deprecated option.</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 thisaddress is used depends on the config file in use. For the builtinconfigurations, 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 anysuggestions 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 givenwith the <CODE><A HREF="#option-C">-C</A></CODE> option that has no path inits 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 specifiedusing <CODE>--cfg-path</CODE>.</P><DT><B><CODE>--lib file</CODE></B><DD><P>Links a library to the output. Use this command line option instead of justnaming the library file, if the linker is not able to determine the filetype 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 insteadof just naming the object file, if the linker is not able to determine thefile 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 filepassed to the linker that has no path in its name is searched in currentdirectory, 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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -