sbklyu
sbklyu

Reputation: 21

What's the meaning of (i.function name) section in ARMCC (C++)?

I found out (i.function name) section in map file after build completion.

======================================================

ex)

[foo1.h] // inline function definition and declaration

__forceinline UINT32 func1(VOID) { ... }

[foo2.cpp] // inline function used

#include "foo1.h"

UINT32 func2(VOID) { ... func1(); // Non-inline in compile time }

[Map File]

foo2.o(.text) refers to foo2.o(i.func1) for func1

======================================================

A typical section in the map file looks like: (.text), (.ARM.exidx), (.data), (.constdata), (.bss), (USER Defined Section Name), ...

After several build tests, I guess (i.function name) section appears when the function that defined inline but compiler does not apply inline makes AREA symbol in object file to make out-of line version. And such a function is located in (i.function name) section. If all inline functions are inline, there is no symbol or (i.function name) section.

Why is the inline function that is not inline applied located in that section?(Not .text?)

What is the exact meaning of (i.function name) section?

I looked up the following documents but could not get the answer I wanted about the content.

Upvotes: 2

Views: 168

Answers (1)

Jose
Jose

Reputation: 3460

The compiler will generate one section for each function when the flag --split_sections is included (see here), being the assigned name of the section i.functionName.

Be aware that this flag might increase the size of the code, due to missing potential optimisations related to sharing resources.

On the other side, inline will (from wikipedia):

if required, emit a function shared among translation units, typically by putting it into the common section of the object file for which it is needed

So both together without any control (or restriction about each other) may end up in a call to the wrong segment.

Upvotes: 0

Related Questions