2.3.1测试

1 编辑并运行2.3.1中的代码

要求在不修改t2.c 和 t1.c中main函数中的代码的情况下,程序运行结果是你的后四位学号

t1.c

#include <stdio.h>

int g = 1908;
static int s;

int main()
{
int a = 1;
static int c = 3;
int b = 2;
c = mysum(a,b);
printf("sum = %d\n",c);
return 1;
}


t2.c

extern int g;
int mysum(int x ,int y)
{
return x+y+g;
}


运行结果

2.3.1测试_可执行文件

2网上学习objdump命令

 

3用objdump分析第1步中的可执行文件和目标文件

objdump -S a.out 反汇编源代码

2.3.1测试_javascript_02

objdump -f a.out查看文件头信息

2.3.1测试_#include_03

代码段

2.3.1测试_可执行文件_04

数据段

2.3.1测试_linux_05