Bingfeng Mei wrote on 23 July 2008 15:46:
> The foo function is inlined into bar anyway even they have different > section attribute. Is this a bug or expected behaviour? Well, I would expect it, but only in the light of knowing how the compiler works. Sections are outside the scope of the C standard, so there is nothing defined for how they would interact with inlining, but what I'd expect to happen is that the section attribute would apply to any out-of-line copy of the function body emitted, and would not apply to the body of the function where it's inlined into another, because that can't even make any sense. You could attribute ((__noinline__) it to prevent it getting inlined at all, but I don't suppose there's any way of saying "Only inline into other functions also in the same section". That might well be a useful new attribute to invent. cheers, DaveK -- Can't think of a witty .sigline today....