7. Getting Image Details

7.1. Overview

  • The linker provides options for getting information about the files it generates.

  • You can use following options to get information about how your file is generated by the linker, and also extract useful diagnostic information during the linking process.

7.2. Supported Diagnostic Options

  • –Map

    Displays the image memory map, and contains the address and the size of each load region, execution region, and input section in the image, including linker-generated input sections.

  • -MapStyle=[Text|YAML|Binary]

    Display the Map information in Text/YAML/Binary format.

  • -MapDetail <value>

    Detail information in the map file

  • –verbose

    Displays detailed information about the link operation, including the objects that are included and the libraries that contain them.

  • –trace

    Allows tracing of various information in linker.

    • all-symbols - tracing of all symbols

    • reloc - tracing of relocations

    • symbol=<symbol name> - Allows tracing of a particular symbol. It also supports regular expressions

    • section=<section name> - Allows tracing of a particular section. Supports regular expressions.

    • GarbageCollection - tracing of garrbage collected symbols

    • Trampolines - tracing of trampolines.

    • LTO - Allows tracing of LTO.

  • -color <value>

    Enable color output for diagnostics

  • -display_hotness <value>

    Display hotness information for optimization remarks

  • –emit-timing-stats <value>

    Emit time statistics of various linker operations to the specified file

  • -print-timing-stats

    Print time statistics of various linker operations to console

  • –time-region <value>
    • Emit time statistics for specified region of linker operation.

    • Users can provide <value> as “plugin” to display timing stats of all user plugins

    • Otherwise, we can provide particular plugin’s name as <value> of –time-region option to display stats of a particular plugin.

  • –version

    Print the Linker version and also lists the targets supported by the linker.