This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: static functions appearing in the symbol table


On 08/23/2015 07:15 AM, Martin Faltesek wrote:
While using gcc, I've noticed that some static functions appear in the
symbol table while others do not. What are the conditions that control
when a static function's symbol appears? I would have thought all
statics would not be included.

At a high level, a static function whose calls in a program are all
inlined will not have an entry in the symbol table. A static function
that's not completely inlined will. What is and isn't inlined depends
on optimizations in effect and on attributes (e.g., function with the
always_inline attribute will likely not a have a symbol even at -O0,
while a trivial static function that's declared with attribute
noinline will even at -O1 and higher).

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]