You copied the Doc URL to your clipboard.

--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
Was this page helpful? Yes No