7.144 --split_sections

Generates one ELF section for each function in the source file.

Output sections are named with the same name as the function that generates the section, but with an i. prefix.


If you want to place specific data items or structures in separate sections, mark them individually with __attribute__((section(...))).
If you want to remove unused functions, ARM recommends that you use the linker feedback optimization in preference to this option. This is because linker feedback produces smaller code by avoiding the overhead of splitting all sections.


This option reduces the potential for sharing addresses, data, and string literals between functions. Consequently, it might increase code size slightly for some functions.


int f(int x)
    return x+1;
Compiling this code with --split_sections produces:
        AREA ||i.f||, CODE, READONLY, ALIGN=2
        ADD      r0,r0,#1
        BX       lr
Related reference
7.30 --data_reorder, --no_data_reorder
7.60 --feedback=filename
7.107 --multifile, --no_multifile
9.46 __attribute__((section("name"))) function attribute
9.74 #pragma arm section [section_type_list]
2.14 Linker feedback during compilation
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.