Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sig/caotral/binary/elf.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class Caotral::Binary::ELF
include Enumerable[Caotral::Binary::ELF::Section]

attr_reader sections: Array[Caotral::Binary::ELF::Section]
attr_reader program_headers: Array[Caotral::Binary::ELF::ProgramHeader]
attr_accessor header: Caotral::Binary::ELF::Header?

def initialize: () -> void
Expand All @@ -11,5 +12,5 @@ class Caotral::Binary::ELF
def select_by_name: (String | Symbol) -> Array[Caotral::Binary::ELF::Section]
def index: (String | Symbol) -> Integer?
def select_by_names: (Array[String | Regexp]) -> Array[Caotral::Binary::ELF::Section]
def without_section: (String | Symbol) -> Array[Caotral::Binary::ELF::Section]
def without_sections: (Array[String | Regexp]) -> Array[Caotral::Binary::ELF::Section]
end
12 changes: 7 additions & 5 deletions sig/caotral/linker.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ class Caotral::Linker
@output: String
@linker: String
@options: Array[String]
@needed: Array[String]
@executable: bool
@shared: bool
@pie: bool
@debug: bool

def self.link!: (inputs: Array[String], ?output: String, ?linker: String, ?debug: bool, ?shared: bool, ?executable: bool) -> void
def initialize: (inputs: Array[String], ?output: String, ?linker: String, ?linker_options: Array[String], ?executable: bool, ?shared: bool, ?debug: bool) -> void
def link: (inputs: Array[String], ?output: String, ?shared: bool, ?debug: bool, ?executable: bool) -> void
def self.link!: (inputs: Array[String], ?output: String, ?linker: String, ?debug: bool, ?shared: bool, ?executable: bool, ?pie: bool, ?needed: Array[String]) -> void
def initialize: (inputs: Array[String], ?output: String, ?linker: String, ?linker_options: Array[String], ?executable: bool, ?shared: bool, ?pie: bool, ?debug: bool, ?needed: Array[String]) -> void
def link: (inputs: Array[String], ?output: String, ?shared: bool, ?debug: bool, ?executable: bool, ?pie: bool) -> void

def link_command: (inputs: Array[String], ?output: String, ?shared: bool, ?debug: bool) -> String
def link_command: (inputs: Array[String], ?output: String) -> String
def libpath: () -> String
def gcc_libpath: () -> String
def to_elf: (inputs: Array[String], ?output: String, ?debug: bool, ?shared: bool, ?executable: bool) -> String
def to_elf: (inputs: Array[String], ?output: String, ?debug: bool, ?shared: bool, ?executable: bool, ?pie: bool, ?needed: Array[String]) -> String
end
12 changes: 8 additions & 4 deletions sig/caotral/linker/builder.rbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
class Caotral::Linker::Builder
@elf_objs: Array[Caotral::Binary::ELF]
@symbols: Hash[Symbol, Set[String]]
@symbols: Hash[Symbol, untyped]
@linker_metadata: Hash[Symbol, untyped]
@executable: bool
@debug: bool
@shared: bool
@pie: bool
@needed: Array[String]

attr_reader symbols: Hash[Symbol, Set[String]]
attr_reader symbols: Hash[Symbol, untyped]
attr_reader linker_metadata: Hash[Symbol, untyped]

def initialize: (elf_objs: Array[Caotral::Binary::ELF], ?executable: bool, ?debug: bool, ?shared: bool) -> void
def initialize: (elf_objs: Array[Caotral::Binary::ELF], ?executable: bool, ?debug: bool, ?shared: bool, ?pie: bool, ?needed: Array[String]) -> void
def build: () -> Caotral::Binary::ELF
def resolve_symbols: () -> Hash[Symbol, Set[String]]
def resolve_symbols: () -> Hash[Symbol, untyped]
end
16 changes: 16 additions & 0 deletions sig/caotral/linker/layout.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class Caotral::Linker::Layout
@elf: Caotral::Binary::ELF
@shared: bool
@executable: bool
@pie: bool
@file_offset: Integer
@section_headers_offset: Integer

attr_reader debug: bool?
attr_reader shared: bool
attr_reader executable: bool
attr_reader pie: bool

def initialize: (elf: Caotral::Binary::ELF, shared: bool, executable: bool, pie: bool) -> void
def apply!: () -> Caotral::Binary::ELF
end
14 changes: 14 additions & 0 deletions sig/caotral/linker/writer.rbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
class Caotral::Linker::Writer
@elf_obj: Caotral::Binary::ELF
@output: String
@debug: bool
@executable: bool
@shared: bool
@pie: bool
@program_headers: Array[Caotral::Binary::ELF::ProgramHeader]
@write_sections: Array[Caotral::Binary::ELF::Section]

attr_reader elf_obj: Caotral::Binary::ELF
attr_reader output: String
attr_reader debug: bool
attr_reader program_headers: Array[Caotral::Binary::ELF::ProgramHeader]

def self.write!: (elf_obj: Caotral::Binary::ELF, output: String, ?debug: bool, ?executable: bool, ?shared: bool) -> String
def initialize: (elf_obj: Caotral::Binary::ELF, output: String, ?debug: bool, ?executable: bool, ?shared: bool, ?pie: bool) -> void
def write: () -> String
Expand Down
Loading