7.155 --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.

Note

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.

Restrictions

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

Example

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