Module Dissector
Dissector pass for analyzing ELF object files.
The dissector analyzes all object files involved in a link to compute the total size of allocated ELF sections. This information is used to partition object files to prevent relocation overflow when linking very large executables with the small code model.
type error = | Measure_error of Measure_object_files.error| Partition_error of Partition_object_files.error| Partial_link_error of Partial_link.error| Nodynlink_incompatible
Errors that can occur during the dissector pass.
exception Error of Dissector.errorException wrapper for dissector errors.
val report_error : Stdlib.Format.formatter -> Dissector.error -> unitPretty-print a dissector error.
module Result : sig ... endResult of running the dissector. After the dissector runs, OCaml object files (ml_objfiles, startup_obj) are baked into the partition files. Passthrough files (ccobjs, runtime_libs) bypass partial linking and are passed directly to the final linker. Use Build_linker_args.build to convert this result into linker arguments.
val run :
unix:(module Compiler_owee.Unix_intf.S) ->
temp_dir:string ->
ml_objfiles:string list ->
startup_obj:string ->
ccobjs:string list ->
runtime_libs:string list ->
cached_genfns:string option ->
Dissector.Result.tRun the dissector pass.
Analyzes all object files that will be involved in a link, computes the total size of allocated ELF sections, partitions files to stay under the threshold, partially links each partition, and extracts relocations that need conversion to use an intermediate PLT or GOT.
The startup_obj is analyzed like all other .o files but may need to be handled specially during partitioning.
Raises Error (Partition_error (File_exceeds_partition_size _)) if any single file exceeds the partition threshold.
Raises Error (Partial_link_error _) if partial linking fails.
Raises an error if Target_system is not Linux.