rlink is the linker used to produce Riva binaries. The linker accepts binary object files and libraries as well as linker scripts.
The basic invocation for rlink is rlink [options] input-files. By default, no output files are produced. The order of the input files is unimportant, all files are loaded before any linking is done.
Option | Description |
---|---|
-o filename | Outputs the Riva binary to filename. If this option is omitted, no Riva binary is created. |
-? filename | Generates a listing file filename. |
-l filename | Links in the file filename. This option is only present for IDEs that automatically add -l before linked files. |
-L path | Adds path to the linker search path. The search path is used for all linked files, not just library (.a/.lib) files. |
-m platform | Sets the platform for generated output to platform. |
-v version | Sets the version tag in the generated Riva binary to version. |
The linker accepts script files, which should have the extension .rlink, which are essentially Lua programs with a number of predefined variables/functions. Any number of script files may be linked into a single module.
Function | Description |
---|---|
export(int, ext, type) | Exports the symbol int as ext. If ext is omitted, int is used. type should be one of CONSTANT or VARIABLE, if omitted, CONSTANT is used. |
require(module) | Specifies that the module should be loaded with the current module, even though no symbol is imported from it. |
Platform | The target platform of the current module. |
module(module) | Specifies the module containing the imported symbols; see import. |
prefix(prefix) | Specifies a prefix that will be added to the beginning of each imported symbol; see import(). |
import(int, ext, type) | Specifies that during linkage, the symbol ext should be resolved to the symbol module.int. If ext is omitted, prefix+int is used. type should be one of CONSTANT or VARIABLE, if omitted, CONSTANT is used. |
include(filename) | Links in the file filename. |