# Kerbal Linker (kld)
[](https://github.com/newcomb-luke/kOS-KLinker)
[](https://crates.io/crates/klinker)
[]()
[]()
[](https://deps.rs/repo/github/newcomb-luke/kOS-KLinker)
[]()
The Kerbal Linker, or KLinker is a completely custom built linker designed to support development of a compiler toolchain for Kerbal Operating System. KLinker links KerbalObject files into KerboScript Machine Code files which can be run inside of kOS.
To be able to inspect the files that this program consumes and outputs, the tool [kDump](https://github.com/newcomb-luke/KDump) was created.
This linker will successfully create both executables and shared libraries if supplied compliant KerbalObject files that follow the KerbalObject file format [specification](https://github.com/newcomb-luke/kOS-KLinker/blob/main/docs/KO-file-format.md). These KerbalObject files can be created by any assembler or compiler built to emit them, such as the [Kerbal Assembler](https://github.com/newcomb-luke/kOS-KASM).
## Features
* Symbol relocation
* Local symbol support
* Link-time file size optimization
## Installation
The Kerbal Linker can either be installed via [cargo](https://github.com/rust-lang/cargo) through [crates.io](https://crates.io/), or as a standalone binary.
#### Windows
- Download the .msi file from Releases on the right
- Run the installer
- **kld** should now be added to your PATH and available from any CMD or Powershell window
#### Arch Linux
- Download the PKGBUILD from Releases on the right
- Copy it to a temporary folder
- Run `makepkg -si` to install **klinker** and all of its dependencies.
- **kld** should now be added to your PATH and available from any terminal
#### Standalone Executables
- Download and extract the .zip file from Releases on the right
- Place the executable in the desired location
- Run the executable through the terminal, Powershell on Windows or the default terminal on Mac OS or Linux.
#### Cargo
```
cargo install klinker
```
**kld** should then be added to your shell's PATH, and can be run from any terminal
## Usage
The Kerbal Linker can be invoked after installation as **kld**
Help can be accessed from the program itself by running:
```
kld --help
```
The basic format for kld arguments is:
```
kld [FLAGS] [OPTIONS] ... -o