jon.recoil.org

Module Extract_relocations

Extract relocations from partially-linked object files.

This module reads ELF object files and extracts relocations that need to be converted to use an intermediate PLT or GOT when linking with the dissector code model.

module Relocation_entry : sig ... end

Information about a single relocation that needs conversion.

type t

The result of extracting relocations from object files.

Returns relocations with type R_X86_64_PLT32 that need PLT entries.

Returns relocations with type R_X86_64_REX_GOTPCRELX that need GOT entries.

val extract : (module Compiler_owee.Unix_intf.S) -> filename:string -> Extract_relocations.t

extract unix ~filename reads the ELF object file at filename and extracts relocations from the .rela.text section that need to be converted for the medium code model.

Returns the lists of PLT32 and REX_GOTPCRELX relocations found.

val extract_from_linked_partitions : (module Compiler_owee.Unix_intf.S) -> Partition.Linked.t list -> Extract_relocations.t

extract_from_linked_partitions unix linked_partitions extracts relocations from all the partially-linked object files.

Returns combined relocation information from all partitions.