jon.recoil.org

Module Linker_script

Generate linker scripts for the dissector.

This module generates a linker script that places partition sections in the correct output sections. It optionally incorporates an existing linker script provided via --script= on the linker command line.

val generate : existing_script:string option -> partitions:Partition.Linked.t list -> string

generate ~existing_script ~partitions generates a linker script string.

  • parameter existing_script

    Optional path to an existing linker script to include. This is extracted from -Wl,-T,<path> or -Wl,--script=<path> in Clflags.all_ccopts by the dissector.

  • parameter partitions

    List of linked partitions. The first partition (Main) is skipped. Subsequent partitions get sections named .caml.p1.*, .caml.p2.*, etc.

val write : output_file:string -> existing_script:string option -> partitions:Partition.Linked.t list -> unit

write ~output_file ~existing_script ~partitions generates a linker script and writes it to the specified file.