test1:
base.h:


















derived1.cpp:














derived2.cpp:














> nm derive1.o
00000000 W _._6base_c
00000000 W _._6derive
00000000 W __6base_c
00000000 W __6derive
00000000 ? __EXCEPTION_TABLE__
00000000 ? __FRAME_BEGIN__
U __builtin_delete
U __builtin_new
U __rethrow
U __rtti_si
U __rtti_user
00000000 W __tf6base_c
00000000 W __tf6derive
00000008 C __ti6base_c
0000000c C __ti6derive
00000000 V __vt_6base_c
00000000 V __vt_6derive
00000000 T f1__Fv
00000000 t gcc2_compiled.
00000000 W getkind__6base_c
00000000 W getkind__6derive
> nm derive2.o
00000000 W _._6base_c
00000000 W _._6derive
00000000 W __6base_c
00000000 W __6derive
00000000 ? __EXCEPTION_TABLE__
00000000 ? __FRAME_BEGIN__
U __builtin_delete
U __builtin_new
U __rethrow
U __rtti_si
U __rtti_user
00000000 W __tf6base_c
00000000 W __tf6derive
00000008 C __ti6base_c
0000000c C __ti6derive
00000000 V __vt_6base_c
00000000 V __vt_6derive
00000000 T f2__Fv
00000000 t gcc2_compiled.
00000000 W getkind__6base_c
00000000 W getkind__6derive
test2
base.h:
















base.cpp:














> nm base.o
00000000 W _._6base_c
00000000 W _._6derive
00000000 ? __FRAME_BEGIN__
U __builtin_delete
U __rtti_si
U __rtti_user
00000000 W __tf6base_c
00000000 W __tf6derive
00000008 C __ti6base_c
0000000c C __ti6derive
00000000 V __vt_6base_c
00000000 V __vt_6derive
00000000 t gcc2_compiled.
00000000 T getkind__6base_c
00000010 T getkind__6derive
> nm derive1.o
00000000 W __6base_c
00000000 W __6derive
00000000 ? __EXCEPTION_TABLE__
00000000 ? __FRAME_BEGIN__
U __builtin_delete
U __builtin_new
U __rethrow
U __vt_6base_c
U __vt_6derive
00000000 T f1__Fv
00000000 t gcc2_compiled.
> nm derive2.o
00000000 W __6base_c
00000000 W __6derive
00000000 ? __EXCEPTION_TABLE__
00000000 ? __FRAME_BEGIN__
U __builtin_delete
U __builtin_new
U __rethrow
U __vt_6base_c
U __vt_6derive
00000000 T f2__Fv
00000000 t gcc2_compiled.
--------------------------------------------------------------------------------------------------------------------------------
q1: vitual function 一般会被拒绝 inline化,那么的定义在哪里?
q2: complier一般将vtbl放在第一个没有inline的vitual function的定义得编译单元内,如所有的virtual function都inline了,vtbl放在哪里?