Deterministic symbol resolution and link-map diagnostics for ELF64 relocatable objects.
Dependencies
moon add oilleelssq-wq/moonlinklet input = @moonlink.parse_object("main.o", bytes)
let report = @moonlink.resolve_objects([input])
println(report.to_link_map())moon run cmd/moonlink --target wasm-gc -- resolve main.o helper.omoon run cmd/moonlink --target wasm-gc -- resolve --json main.o helper.omoon fmt
moon check --deny-warn
moon test --deny-warn
moon test --target wasm
moon build cmd/moonlink --target wasm-gcpub(all) suberror LinkError {
InvalidElf(String)
UnsupportedObjectType(UInt)
UnsupportedClass
UnsupportedMachine
MissingSymbolTable
InvalidRelocation(String)
}pub(all) enum LinkBinding {
Local
Global
Weak
Other(UInt)
}pub(all) struct LinkInput {
name : String
machine : LinkMachine
sections : Array[LinkSection]
symbols : Array[LinkSymbol]
relocations : Array[LinkRelocation]
}pub(all) enum LinkMachine {
X86_64
AArch64
}pub(all) struct LinkRelocation {
target_section : UInt
offset : UInt64
symbol_index : UInt
kind : UInt
addend : Int64
has_addend : Bool
}pub(all) struct LinkResolution {
symbols : Array[ResolvedSymbol]
unresolved : Array[UnresolvedSymbol]
duplicates : Array[DuplicateDefinition]
object_count : Int
input_symbol_count : Int
}pub(all) struct LinkSection {
index : UInt
name : String
kind : UInt
flags : UInt64
address : UInt64
size : UInt64
alignment : UInt64
entry_size : UInt64
}pub(all) struct LinkSymbol {
index : UInt
name : String
binding : LinkBinding
kind : LinkSymbolType
visibility : UInt
section_index : UInt
value : UInt64
size : UInt64
}pub(all) enum LinkSymbolType {
NoType
Object
Func
Section
File
Common
Tls
Other(UInt)
}pub(all) struct ResolvedSymbol {
name : String
binding : LinkBinding
kind : LinkSymbolType
object_index : UInt
object_name : String
symbol_index : UInt
value : UInt64
size : UInt64
}pub(all) struct SymbolReference {
object_index : UInt
object_name : String
symbol_index : UInt
}Install
Download zipDeterministic symbol resolution and link-map diagnostics for ELF64 relocatable objects.
Dependencies