In the following code, compiled with
g++ cls.cc -Wall -W -g3 -o cls
why only only virtual functions f1, f2 and constructor is listed by nm.
Only debugging symbols for virtual functions are included in
executable output file ?
//cls.cc
#include <iostream>
using namespace std;
class test
{
public:
int u;
test(int t){u=t;};
virtual void f1(){
cout <<u<<endl;
}
virtual void f2(int t){u=t;};
void f3(int t){u=t;};
};
int main(int argc, char **argv)
{
test t(100);
}
$nm -C cls | grep test::
0804874e W test::f1()
08048740 W test::f2(int)
08048728 W test::test(int)