02 2020 档案

gnu make
摘要:模式替换 Another type of substitution reference lets you use the full power of the patsubst function. It has the same form ‘$(var:a=b)’ described above, e 阅读全文

posted @ 2020-02-23 22:02 yanhc 阅读(157) 评论(0) 推荐(0)

工程引用libm.a文件的sin函数后
摘要:更改前后的main.c //#include <math.h> int var_data = 1; int var_bss; int main() { double d; // d = sin(3.14/2); return 0; } View Code #include <math.h> int 阅读全文

posted @ 2020-02-23 20:39 yanhc 阅读(322) 评论(0) 推荐(0)

3803 register initialization
摘要:wim寄存器 window invalid mask,窗口无效屏蔽寄存器,如果某bit为1,则表示该窗口无效,不能使用。 初始化,设置%psr.CWP=0,即当前使用win0;设置wim=2,即只有win1不能使用,win0,7,6,5,4,3,2都能使用。 save时,CWP-1,变为窗口7;再s 阅读全文

posted @ 2020-02-16 19:21 yanhc 阅读(245) 评论(0) 推荐(0)

bin utilities related
摘要:objdump -S, 如果有源程序的话,将源程序与汇编代码混合在一起。 使用该选项时,输入的目标文件需要有调试信息,即用gcc -g生成的目标文件才可以,因为,调试信息中才有源程序信息。 --adjust-vma=offset 对于a.out,似乎没有编码节的地址,因此,dump出来的节内容都是从 阅读全文

posted @ 2020-02-16 14:22 yanhc 阅读(245) 评论(0) 推荐(0)

ELF文件之九——使用链接脚本-2个函数-data-bss-temp-call-debug信息-struct
摘要:main.c int enable; int test = 1; struct aaa { int membera; char memberb; }s_aaa; int main() { int temp; add(); del(); s_aaa.membera = 1; s_aaa.memberb 阅读全文

posted @ 2020-02-15 15:12 yanhc 阅读(190) 评论(0) 推荐(0)

ELF文件之八——使用链接脚本-2个函数-data-bss-temp-call-debug信息
摘要:gcc编译选项可以设置生成调试信息, debug信息格式有stabs,coff,xcoff,dwarf。 常用的有两种格式,stab和dwarf,stab较早,dwarf较新。两种格式介绍:https://www.ibm.com/developerworks/cn/opensource/os-deb 阅读全文

posted @ 2020-02-15 11:33 yanhc 阅读(707) 评论(0) 推荐(0)

sparc v8 汇编语言语法
该文被密码保护。

posted @ 2020-02-12 18:37 yanhc 阅读(74) 评论(0) 推荐(0)

关于ELF文件和BIN文件
该文被密码保护。

posted @ 2020-02-09 22:27 yanhc 阅读(65) 评论(0) 推荐(0)

ELF文件之七——使用链接脚本-2个函数-data-bss-temp-call
摘要:main.c int enable; int test = 1; int main() { int temp; add(); return 0; } int add() { return 0; } View Code o反汇编的地址都是0起始,elf的地址都是映射后的地址。 多了一个.rela.te 阅读全文

posted @ 2020-02-09 20:20 yanhc 阅读(239) 评论(0) 推荐(0)

ELF文件之六——使用链接脚本-2个函数-data-bss-temp
摘要:main.c int enable; int test = 1; int main() { int temp; return 0; } int add() { return 0; } View Code elf反汇编结果如下,可以看出main函数中的栈多开了8字节,虽然局部变量只是int,占4字节 阅读全文

posted @ 2020-02-09 19:42 yanhc 阅读(234) 评论(0) 推荐(0)

ELF文件之五——使用链接脚本-2个函数-data-bss
摘要:main.c int enable; int test = 1; int main() { return 0; } int add() { return 0; } View Code bss段在elf中虽然size是4,但并不占filesize,节头表如下图所示 程序头中,项目2的文件大小为4(4字 阅读全文

posted @ 2020-02-09 19:22 yanhc 阅读(278) 评论(0) 推荐(0)

ELF文件之四——使用链接脚本-2个函数-data
摘要:main.c int test = 1; int main() { return 0; } int add() { return 0; } View Code main.o 反汇编可以看到多了.text节的反汇编,存储的是全局变量的初始化数值 main.o对比,text段后面多了00 00 00 0 阅读全文

posted @ 2020-02-09 18:17 yanhc 阅读(221) 评论(0) 推荐(0)

ELF文件之三——使用链接脚本-2个函数
摘要:main.c int main() { return 0; } int add() { return 0; } View Code main.o的比较 与之二相比,section header offset由0x90变为0xA4,增加0x14,即add函数的大小 需要注意的是,后面section h 阅读全文

posted @ 2020-02-09 17:51 yanhc 阅读(277) 评论(0) 推荐(0)

ELF文件之二——使用链接脚本
该文被密码保护。

posted @ 2020-02-09 17:05 yanhc 阅读(38) 评论(0) 推荐(0)

gcc, ld
摘要:GCC gcc除了具备基本的c文件编译功能外,还把其它工具的功能也集成了进来,比如as的汇编功能,ld的链接功能。 因此,gcc也可以通过-Wa, option,将option传给汇编器as;也可以通过-Wl, option,将option传给链接器ld。 -N,gcc手册中没看到该选项,这是属于链 阅读全文

posted @ 2020-02-06 20:31 yanhc 阅读(3550) 评论(0) 推荐(0)

导航