Linker
The linker is responsible to solve the referencement of labels, and eventually append library source codes to the build process.
To disable the automatic inclusion of 'header.s' and 'tail.s', just modify your OSDK_CONFIG.BAT file, and add the following:
SET OSDKLINK=-B
The -d defines the location of the library files. It must be followed by a path:
-d /usr/oric/lib/
The -s defines the location of the sources files. It must be followed by a path:
-s /sources/oric/demo/
The -o defines the name of the outputed file. It must be followed by the file name. By default the output name will be 'go.s':
-o final.s
The -l switch prints out defined labels.Usefull when building lib index files.
The -v switch activates the verbose mode.
The -q switch enables the quiet mode.
The -b switch disables the automatic inclusion of 'header.s' and 'tail.s
The -f inserts a #file directives before each linked file.
The -i defines an additional path to search for include files. It must be followed by a path:
-i /usr/oric/include/
The -r defines the language tag used for conditional character replacement (see #pragma osdk replace_characters_if below). It must be followed by a tag string:
-r french
The -S imports symbols from an XA symbol file (-l output). Imported symbols are written as equates in the output file and marked as defined, preventing library files that define those symbols from being pulled in. If the module source redefines an imported symbol, the module's definition wins. It must be followed by a filename:
-S symbols_Kernel
The -t injects a .text origin from an imported symbol. When used with -S, Link65 emits ".text / * = symbolname" at the top of the output, setting the assembly origin for the module without needing -bt or OSDKADDR. It must be followed by a symbol name:
-t _KernelEndText
The -g filters -S symbol imports using an XA equates file (from XA -E output). Only symbols present in the filter file are imported, preventing local labels from causing name collisions in modules. It must be followed by a filename:
-g kernel_exports.h
The linker supports special pragma directives embedded in the source files to control its behaviour:
#pragma osdk replace_characters defines a set of search/replace pairs to apply to all filtered output lines. This is used to perform text localization when the assembler source contains characters that need to be mapped differently depending on the target platform. The syntax uses a separator character of your choice, followed by pairs of tokens separated by that character:
#pragma osdk replace_characters | sourcechar|replacementchar ...
Important limitation: each replace_characters directive unconditionally replaces the previously active replacement table. This means it only works correctly if there is no other replace_characters directive appearing earlier in the linked files that would override it before the texts to localize are reached. For any project targeting more than one language, using replace_characters_if is strongly recommended instead.
#pragma osdk replace_characters_if LANGUAGE_TAG works identically to replace_characters, but only takes effect if the tag passed to the -r command line option matches LANGUAGE_TAG. This allows multiple language-specific replacement tables to coexist in a single source file:
#pragma osdk replace_characters_if french | e|é a|à #pragma osdk replace_characters_if spanish | n|ñ
Only the pragma whose tag matches the -r argument will be applied; the others are silently ignored.
#pragma osdk import forces the linker to import specific library symbols without requiring dead code references in the source. Symbols listed after the pragma (space, tab, or comma separated) are treated as label references, causing Link65 to pull in the library files that define them:
#pragma osdk import _memset, _memcpy, mul16i, mul16u
No known problem - please signal any issue on the Cross development tools forum.
Fixed in OSDK 1.9
Details: While working on Telemon, found out that it was impossible to link a module containing #include "../oric-common/include/asm/telemon.h"
Fixed in OSDK 1.8
Details: If you include files that define labels (ex: the loader data table) the linker will generally ignore them and throw a undefined externals symbols error.
comments powered by Disqus
