Re: static functions appearing in the symbol table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux