-bash-2.05b$ g++ -g -o main main.o -L. -lfoobar
/usr/bin/ld: skipping incompatible ./libfoobar.so when searching for -lfoobar
/usr/bin/ld: cannot find -lfoobar
-bash-2.05b$ nm libfoobar.so
0000000000100ac8 d DW.ref.__gxx_personality_v0
0000000000100bd0 A _DYNAMIC
0000000000100d78 A _GLOBAL_OFFSET_TABLE_
w _Jv_RegisterClasses
0000000000100d58 d __CTOR_END__
0000000000100d50 d __CTOR_LIST__
0000000000100d68 d __DTOR_END__
0000000000100d60 d __DTOR_LIST__
0000000000100ad0 r __EH_FRAME_BEGIN__
0000000000100b88 r __FRAME_END__
0000000000100d70 d __JCR_END__
0000000000100d70 d __JCR_LIST__
0000000000100dd8 A __bss_start
w __cxa_finalize
w __deregister_frame_info
00000000000009c0 t __do_global_ctors_aux
00000000000008b0 t __do_global_dtors_aux
0000000000100ab8 d __dso_handle
U __gxx_personality_v0
w __register_frame_info
0000000000100dd8 A _edata
0000000000100e30 A _end
00000000000009f8 T _fini
0000000000000830 T _init
00000000000009a0 T bar
0000000000100de0 b completed.1
0000000000000960 T foo
0000000000000910 t frame_dummy
0000000000100e00 b object.2
0000000000100ac0 d p.0
U printf
-bash-2.05b$ cd tmp
-bash-2.05b$ nm libfoobar.so 这个是在linux中生成的so文件
0000000000001754 d DW.ref.__gxx_personality_v0
0000000000001640 a _DYNAMIC
0000000000001734 a _GLOBAL_OFFSET_TABLE_
w _Jv_RegisterClasses
0000000000001630 d __CTOR_END__
000000000000162c d __CTOR_LIST__
0000000000001638 d __DTOR_END__
0000000000001634 d __DTOR_LIST__
0000000000000628 r __FRAME_END__
000000000000163c d __JCR_END__
000000000000163c d __JCR_LIST__
0000000000001758 A __bss_start
w __cxa_finalize@@GLIBC_2.1.3
0000000000000550 t __do_global_ctors_aux
0000000000000440 t __do_global_dtors_aux
000000000000174c d __dso_handle
w __gmon_start__
U __gxx_personality_v0@@CXXABI_1.3
00000000000004d7 t __i686.get_pc_thunk.bx
0000000000001758 A _edata
000000000000175c A _end
0000000000000584 T _fini
00000000000003b8 T _init
000000000000051c T bar
0000000000000410 t call_gmon_start
0000000000001758 b completed.5758
00000000000004dc T foo
00000000000004a0 t frame_dummy
0000000000001750 d p.5756
U puts@@GLIBC_2.0
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |