23,121
社区成员
发帖
与我相关
我的任务
分享
#
# Makefile
#
all:
gcc -fPIC -c *.c
ar crv libfb.a foo.o bar.o
gcc -shared -o libdemo.so demo.o -L. -lfb
/**
* @file bar.c
* @brief
*/
#include <stdio.h>
int bar(void)
{
return 0;
}
/**
* @file demo.c
* @brief
*/
#include <stdio.h>
int foo(void);
int demo(void)
{
foo();
return 0;
}
/**
* @file foo.c
* @brief
*/
#include <stdio.h>
int foo(void)
{
return 0;
}
int foo2(void)
{
return 0;
}
nm libdemo.so
0000000000200690 a _DYNAMIC
0000000000200828 a _GLOBAL_OFFSET_TABLE_
w _Jv_RegisterClasses
0000000000200668 d __CTOR_END__
0000000000200660 d __CTOR_LIST__
0000000000200678 d __DTOR_END__
0000000000200670 d __DTOR_LIST__
0000000000000658 r __FRAME_END__
0000000000200680 d __JCR_END__
0000000000200680 d __JCR_LIST__
0000000000200850 A __bss_start
w __cxa_finalize@@GLIBC_2.2.5
0000000000000570 t __do_global_ctors_aux
0000000000000490 t __do_global_dtors_aux
0000000000200688 d __dso_handle
w __gmon_start__
0000000000200850 A _edata
0000000000200860 A _end
00000000000005a8 T _fini
0000000000000420 T _init
0000000000000470 t call_gmon_start
0000000000200858 b completed.6145
000000000000053c T demo
0000000000200850 b dtor_idx.6147
000000000000054c T foo
0000000000000557 T foo2
0000000000000510 t frame_dummy