Linkers and Loaders - 无名图书

Linkers and Loaders

出版时间

2001-01-01

ISBN

9788178670379

评分

★★★★★
书籍介绍
Whatever your programming language, whatever your platform, you probably tap into linker and loader functions all the time. But do you know how to use them to their greatest possible advantage? Only now, with the publication of Linkers & Loaders, is there an authoritative book devoted entirely to these deep-seated compile-time and run-time processes. The book begins with a detailed and comparative account of linking and loading that illustrates the differences among various compilers and operating systems. On top of this foundation, the author presents clear practical advice to help you create faster, cleaner code. You'll learn to avoid the pitfalls associated with Windows DLLs, take advantage of the space-saving, performance-improving techniques supported by many modern linkers, make the best use of the UNIX ELF library scheme, and much more. If you're serious about programming, you'll devour this unique guide to one of the field's least understood topics. Linkers & Loaders is also an ideal supplementary text for compiler and operating systems courses.
精彩摘录
  • "每个操作系统都会为运行在该系统下的应用程序提供应用程序二进制接口(Applicatio n Binary Interface)。 ABI包含了应用程序在这个系统下运行时必须遵守的编程约定。ABI总是包含一系列的系统调用和使用这些系统调用的方法,以及关于程序可以使用的内存地址和使用机器寄存器的规定。 从一个应用程序的角度看,ABI既是系统架构的一部分也是硬件体系结构的重点,因此只要违反二者之一的条件约束就会导致程序出现严重错误。在很多情况下,链接器为了遵守ABI的约定需要进行一些重要的工作。 例如,ABI要求每个应用程序包含一个该程序中各例程使用的所有静态数据的地址表,链接器通常会通过收集所有链"
  • "每种ABI都通过将硬件定义的调用指令与内存、寄存器的使用约定组合起来定义了一个 标准的过程调用序列。硬件的调用指令保存了返回地址(调用执行后的指令地址)并跳转到目标过程。在诸如x86这样具有硬件栈的体系结构中返回地址被压入栈中,而在其它体系结构中它会被保存在一个寄存器里,如果必要软件要负责将寄存器中的值保存在内存中。具有栈的体系结构通常都会有一个硬件的返回指令将返回地址推出栈并跳转到该地址,而其它体系结构则使用一个“跳转到寄存器中地址”的指令来返回。 在一个过程的内部,数据寻址可分为4类:  调用者可以向过程传递参数。  本地变量在过程中分配,并在过程返回前释放。  本地静态数据保存在内"
  • "传统的a.out格式为UNIX社区服务了超过10年,但是在UNIX系统5(System V)推出 时,AT&T认为需要一些更好的东西来支持交叉编译、动态链接以及其它的现代系统特性。早期的系统5采用COFF格式,即通用目标文件格式(Common Object File Format),它最初是为交叉编译的嵌入式系统设计的,由于其无扩展版本不支持C++和动态链接,因此并不能在所有的分时系统上都很好的工作。在系统5的后期版本中,COFF被ELF格式替代,即可执行和链接格式(Executable and Linking Format)。ELF同样被流行的自由软件Linux和BSD等类UNIX系统所采用"
用户评论
好书,绝对的好书,建议吃透
内容广,但好多内容自己用不着。收获不大
瞄过中文的译本,没啥太大感觉。还是看 Ian Talyor 的博客吧。
遗憾的是,这是这个领域唯一一本书。
收藏