Module Measure_object_files
Measuring allocated section sizes in object files.
This module computes the total size of allocated ELF sections across a collection of object files, archives, and OCaml compilation units.
Errors that can occur when measuring object files.
exception Error of Measure_object_files.errorException wrapper for measurement errors.
val report_error :
Stdlib.Format.formatter ->
Measure_object_files.error ->
unitPretty-print a measurement error.
The origin of a file, used to determine partition placement.
Note: Passthrough files (C stubs from -cclib, runtime libraries) are separated before measuring and don't use this type.
module File_size : sig ... endInformation about a single file's allocated section size.
val measure_files :
(module Compiler_owee.Unix_intf.S) ->
files:(string * Measure_object_files.file_origin) list ->
Measure_object_files.File_size.t listmeasure_files unix ~files computes the allocated section size for each file in files.
Handles the following file types based on extension:
- .o: ELF object file, analyzed directly
- .a: archive file, all .o members analyzed and summed
Files are tracked to avoid double-counting when the same file appears multiple times. Returns an empty entry for files with unrecognized extensions.
Each file is paired with its origin, which determines partition placement.