On 6/18/07, costin_c <[EMAIL PROTECTED]> wrote:
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)
Wierd assembler file, generated by "-S" parameter, include all
information about test class methods: test,f1,f2,f3
..................................
.string "test::test"
.long 0x5d40
.string "test::f2"
.long 0x5d70
.string "test::f3"
.long 0x5e4d
.string "test::f1"
.long 0x5e71
.string "main"