]> git.sur5r.net Git - cc65/blobdiff - doc/ld65.sgml
Call __seterrno and save a few bytes.
[cc65] / doc / ld65.sgml
index 80cfd4421846924bf565627a87cb192da22633cf..d37beced749309c3cc5a50e03fe4cea46e77651d 100644 (file)
@@ -324,9 +324,8 @@ The library search path contains in this order:
 <item>A compiled in library path which is often <tt>/usr/lib/cc65/lib</tt> on
       Linux systems.
 <item>The value of the environment variable <tt/LD65_LIB/ if it is defined.
-<item>The value of the environment variable <tt/CC65_LIB/ if it is defined.
-      Please note that use of this environment variable is obsolete and may
-      get removed in future versions.
+<item>A subdirectory named <tt/lib/ of the directory defined in the environment
+      variable <tt/CC65_HOME/, if it is defined.
 <item>Any directory added with the <tt><ref id="option--lib-path"
       name="--lib-path"></tt> option on the command line.
 </enum>
@@ -338,12 +337,11 @@ The object file search path contains in this order:
 
 <enum>
 <item>The current directory.
-<item>A compiled in directory which is often <tt>/usr/lib/cc65/lib</tt> on
+<item>A compiled in directory which is often <tt>/usr/lib/cc65/obj</tt> on
       Linux systems.
 <item>The value of the environment variable <tt/LD65_OBJ/ if it is defined.
-<item>The value of the environment variable <tt/CC65_LIB/ if it is defined.
-      Please note that use of this environment variable is obsolete and may
-      get removed in future versions.
+<item>A subdirectory named <tt/obj/ of the directory defined in the environment
+      variable <tt/CC65_HOME/, if it is defined.
 <item>Any directory added with the <tt><ref id="option--obj-path"
       name="--obj-path"></tt> option on the command line.
 </enum>
@@ -355,9 +353,11 @@ The config file search path contains in this order:
 
 <enum>
 <item>The current directory.
-<item>A compiled in directory which is often <tt>/usr/lib/cc65/lib</tt> on
+<item>A compiled in directory which is often <tt>/usr/lib/cc65/cfg</tt> on
       Linux systems.
 <item>The value of the environment variable <tt/LD65_CFG/ if it is defined.
+<item>A subdirectory named <tt/cfg/ of the directory defined in the environment
+      variable <tt/CC65_HOME/, if it is defined.
 <item>Any directory added with the <tt><ref id="option--cfg-path"
       name="--cfg-path"></tt> option on the command line.
 </enum>
@@ -598,6 +598,19 @@ empty (for example because they are of type bss). In that case, the linker
 will create an empty output file. This may be suppressed by assigning an empty
 file name to that memory area.
 
+The <tt/%O/ sequence is also allowed inside a string. So using
+
+<tscreen><verb>
+       MEMORY {
+                   ROM1:  start = $A000, size = $2000, file = "%O-1.bin";
+           ROM2:  start = $E000, size = $2000, file = "%O-2.bin";
+       }
+</verb></tscreen>
+
+would write two files that start with the name of the output file specified on
+the command line, with "-1.bin" and "-2.bin" appended respectively. Because
+'%' is used as an escape char, the sequence "%%" has to be used if a single
+percent sign is required.
 
 <sect1>LOAD and RUN addresses (ROMable code)<p>
 
@@ -819,8 +832,9 @@ The necessary o65 attributes are defined in a special section labeled
 
 The <tt/FORMAT/ section is used to describe file formats. The default (binary)
 format has currently no attributes, so, while it may be listed in this
-section, the attribute list is empty. The second supported format, o65, has
-several attributes that may be defined here.
+section, the attribute list is empty. The second supported format, 
+<htmlurl url="http://www.6502.org/users/andre/o65/fileformat.html" name="o65">, 
+has several attributes that may be defined here.
 
 <tscreen><verb>
     FORMATS {
@@ -950,15 +964,22 @@ __STACKSIZE__=xxx/ on the command line.
 
 <sect1>Builtin configurations<p>
 
-The builtin configurations are part of the linker source. They are also
-distributed together with the machine specific binary packages (usually in the
-doc directory) and don't have a special format. So if you need a special
-configuration, it's a good idea to start with the builtin configuration for
-your system. In a first step, just replace <tt/-t target/ by <tt/-C
+The builtin configurations are part of the linker source. They can be retrieved
+with <tt/--dump-config/ and don't have a special format. So if you need a
+special configuration, it's a good idea to start with the builtin configuration
+for your system. In a first step, just replace <tt/-t target/ by <tt/-C
 configfile/. Then go on and modify the config file to suit your needs.
 
 
 
+<sect1>Secondary configurations<p>
+
+Several machine specific binary packages are distributed together with secondary
+configurations (in the cfg directory). These configurations can be used with
+<tt/-C configfile/ too.
+
+
+
 <sect>Special segments<p>
 
 The builtin config files do contain segments that have a special meaning for
@@ -983,10 +1004,11 @@ This segment contains the startup code which initializes the C software stack
 and the libraries. It is placed in its own segment because it needs to be
 loaded at the lowest possible program address on several platforms.
 
-<sect1>HEAP<p>
+<sect1>ZPSAVE<p>
 
-This segment defines the location of the memory heap used by the malloc
-routine.
+The ZPSAVE segment contains the original values of the zeropage locations used
+by the ZEROPAGE segment. It is placed in its own segment because it must not be
+initialized.