Comment 21 for bug 1418073

Revision history for this message
Terry Guo (terry.guo) wrote :

If you take a closer look, you will find function foo doesn't get inlined for -Os option, which prevents .section1 from being discarded. About why -Os doesn't inline foo, it is simply because inlining function tends to increase code size.

If you replace -Os with -O2, you will find foo gets inlined and the function .section1 will be discard in final elf file.

Again there is no explicit statement saying that functions assigned to different sections shouldn't be inlined.