5.1 编号
Module 4
5.2 目的
熟悉binutils的使用
5.3 实验描述
5.3.1 nm 的使用
5.3.1.1 实验编号
LAB1_MD4_1
5.3.1.2 步骤
gcc –o hello.o –c hello.c
nm hello.o
5.3.1.3 验证
nm hello.o >nm.rpt
5.3.1.4 实验报告
将nmrpt.txt 添加到cvs
cvs add nm.rpt
cvs ci nm.rpt
5.3.2 objdump 的使用
5.3.2.1 实验编号
LAB1_MD4_2
5.3.2.2 步骤
objdump –t hello.o
5.3.2.3 验证
objdump –t hello.o >objdump.rpt
5.3.2.4 实验报告
将objdump.rpt 添加到cvs
cvs add objdump.rpt
cvs ci objdump.rpt
5.3.3 多文件链接编译
5.3.3.1 实验编号
LAB1_MD4_3
5.3.3.2 步骤
目标:
三个函数hello1, hello2, hello3, 分别打印hello world1, hello world2, hello world3, 分别分布在hello1.c hello2.c, hello3.c三个文件中 , 并在hello.c文件中分别执行三个子函数,写Makefile 把它们分别编译成.o 再生成可执行文件hello.exe
步骤从略, 如有困难,请参阅课程讲义,或寻求助教帮助。
5.3.3.3 验证
./hello.exe , 应该打印出3句话
hello.exe >hello.rpt
5.3.3.4 实验报告
cvs ci makefile
cvs tag LAB1_MD4_3 makefile
cvs add hello1.c
cvs ci hello1.c
cvs add hello2.c
cvs ci hello2.c
cvs add hello3.c
cvs ci hello3.c
cvs add hello.rpt
cvs ci hello.rpt