Not able to see all the symbols in the output of "nm" command

Gavin Guo tuffkidtt at gmail.com
Thu Jun 9 20:12:41 EDT 2011


It is possible that non-inline function will be translated to inline
function by compiler. when using back trace, I have suffered the
problems that the function calling sequence is impossible, because one
of the function is missed. Then I objdumped the elf file and found
that the missing function is inlined by compiler; However, you can use
2 method, I knowed, to avoid being inlined by compiler:

1. Putting __attribute__((optimized("O0"))) before the function definition.

2. Using the following gcc extension usage to avoid optimization.
#pragma GCC push_options
#pragma GCC optimized("O0")
your code block...
#pragma GCC pop_options

Gavin Guo



More information about the Kernelnewbies mailing list