On Sun, 23 Aug 2015, 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. > > This observation arose while debugging stack traces in the linux > kernel. (and using ftrace). > > Using arm-linux-gcc 4.9.1. > check your kernel config - the linux kernel has a config option in kernel hacking called CONFIG_OPTIMIZE_INLINING: Kernel hacking ---> ... [*] Allow gcc to uninline functions marked 'inline' <snip - form the help text> This option determines if the kernel forces gcc to inline the functions developers have marked 'inline'. Doing so takes away freedom from gcc to do what it thinks is best, which is desirable for the gcc 3.x series of compilers. The gcc 4.x series have a rewritten inlining algorithm and enabling this option will generate a smaller kernel there. Hopefully this algorithm is so good that allowing gcc 4.x and above to make the decision will become the default in the future. Until then this option is there to test gcc for this. <snip> so I suspect that this is what is causing the discrepencey between functions marked inline in the code and actually being compiled in. This is though linux kernel specific and not actually a gcc issue. also check out "3.10 Options That Control Optimization" on -finline-limit=N and the way it is used to automatically control inlining. thx! hofrat