CLI
qcpu [-o output] [--offset address] file.s | file.o...
: performs preprocessing, assembling and linking of the designated files. A file may be an assembly, object or executable file.qcpu -c [-o output.o] file.s...
: performs only preprocessing and assembling.qcpu -p [-o output.s] file.s...
: performs only preprocessing.
An optimiser option may be set to cut out dead text paths, -O1
(first level optimisation).
0.1 Linker
qcpul [-o output] [--offset address] file.o...
: the jump to main of the linker, called from the linking step ofqcpu
andqcpuc
. An offset is its virtual label linking offset (defaults to 0).
QCPU CLI’s linker combines object files, resolves the reference addresses and reorders the sections based on a linker script [1]. The assembler makes sure that addresses are reachable (e.g. relative vs. absolute jumps). In the future, GNU ld
will be used with the support of the Executable and Linkable Format (ELF).
References
[1]
“GNU binutils: Linker scripts.” GNU. Available: https://sourceware.org/binutils/docs/ld/Scripts.html