文章目录 静态链接 动态链接与加载 动态链接的实现 静态链接 a.c int foo(int a,int b){ return a+b; } b.c int x = 100,y = 200; main.c #include <stdio.h> extern int x,y; int foo(int a,int b); int main(){ printf("%d + %d = %d\n",x, y, foo(x, y)); } readelf -d main.o(图1)