qlink takes one or more QObject files and links them together into one executable file in AIF (or other) format.
qlink is called with a set of options, plus a list of QObject files, which by convention are stored in a subdirectory named 'q'. If there are no arguments, qlink prints a message summarizing its options on the standard error.
Options for qlink are as follows:-
-addr address Set the start address of the output file (default 8000).
-codenames Insert symbol names before CODE symbols.
-creator string Set the creator string. (Join only).
-datanames Insert symbol names before DATA/LIT symbols.
-first function Set the first function (default __aif).
-fussy Warn about out-of-range references.
-join Join the QObject files rather than linking them.
-lib file Treat file as a library file.
-map Print a symbol map to stderr.
-mapall Map all symbols, even pseudo-locals.
-multidef Allow multiple definitions of symbols
-o file Name the output file (default !RunImage).
-procos Set the processor/OS string. (Join only).
-symbols file Write a list of symbols to file.
-t Debug information printed on stderr.
-throwback Use throwback rather than stderr.
-type type Set the type of the output file (default FF8).
-v Verbose.
See a description of the QObject file format for more details.
Built-in symbols begin with `Q$$';
qlink supports the following built-in symbols:-
Q$$StartAddr the start address (set using -addr)
Q$$EndAddr the first free byte after all segments
Q$$CODE_Offset the offset of the CODE segment from the start (= 0)
Q$$CODE_Size the size of the CODE segment
Q$$DATA_Offset \
Q$$DATA_Size |
Q$$LIT_Offset | similarly
Q$$LIT_Size |
Q$$BSS_Offset |
Q$$BSS_Size /
Q$$ROBase base of read-only area (usually 0x8000) (= Q$$StartAddr)
Q$$ROLimit limit of read-only area
Q$$RWBase base of read/write area (not necessarily equal to Q$$ROLimit)
Q$$RWLimit limit of read/write area (= Q$$EndAddr)
Errors are reported on stderr, unless -throwback is used.
When joining files, the `parent object file' name for each symbol is left as it was; thus when constructing libraries, the filename given to qas must be considered carefully.
LIMITATIONS
qlink cannot link older QObject file formats (0 and 1) - it can only handle version 2 file format.
qlink relies on the symbol __aif (or similar) to set up the BSS segment as zero-initialised data using Q$BSS_Offset and Q$$BSS_Size. Symbols in the BSS segment are referenced outside the file, thus memory must be set aside.
Throwback can't yet make use of debug info to open correct source file.
Can't yet determine when some references to functions plus offset are outside the function.
Uses rather a lot of memory (approx. total size of libraries plus double size of output file plus a bit).