2.11并行(待看)
重点在于2.12-2.14,提要:
- 代码如何变得可执行?——compiler、assembler、linker和loader如何工作?
- 比较RISC-V中的array和C中的pointer。(待看)
Java程序的翻译则与C程序有所不同,详见2.15(待看)。
2.16-2.18对比了MIPS、x86和RISC-V三种ISA。
内容:
一图了解C程序的翻译:C程序->compiler->汇编程序->assembler->object file(机器语言模块)->linker->可执行文件(机器语言程序)->loader->内存。
object file组成:header、text segment、static data segment、relocation information、symbol table和debugging information。
当linker将object file翻译为executable file时,有三个步骤:
1.在memory中放code&data。
2.确定instruction中涉及到的地址。
3.Patch both the internal and external references.
在前两步中尤其要注意内存的分配,参考Figure 2.13: