7.6.2.3 Optimization

  • -Wl, --gc-sections

    Garbage collects unused sections.

    Enable garbage collection of unused input sections. It is ignored on targets that do not support this option. The default behavior (of not performing this garbage collection) can be restored by specifying `--no-gc-sections' on the command-line. `--gc-sections' decides which input sections are used by examining symbols and relocations. The section containing the entry symbol and all sections containing symbols undefined on the command-line will be kept, as will the sections containing symbols referenced by dynamic objects.

  • --rodata-writable

    Put read-only data in the writable data section.