c程序链接过程简介内容摘要:

l +10 d \0 M y v a r i a b +20 l e \0 偏移 字符串 0 空字符串 1 helloworld 6 world 12 Myvariable  将函数和变量统称为符号  本地定义的全局符号、 外部符号( External Symbol)、局部符号、段名、行号  符号修饰和函数签名  弱 符号和强符号  extern “C” 2020/11/17 链接的接口 ——符号  编译器与链接器  目标文件  静态链接  动态链接  常用工具介绍 2020/11/17 大纲 2020/11/17 空间与地址分配 File Header .text section .data section .bss section Object File A File Header .text section .data section .bss section Object File B File Header .text section .data section .bss section Ouput File File Header .text section .data section .bss section Object File A Object File B 2020/11/17 空间与地址分配 File Header .text section .data section .bss section Object File A File Header .text section .data section .bss section Object File B File Header Ouput File .text .data .bss 2020/11/17 符号解析与重定位 /* */ extern int shared。 int main() { int a = 100。 swap(amp。 a, amp。 shared)。 } /* */ int shared =1。 void swap(int* a, int* b) { *a ^= *b ^= *a ^= *b。 } $ ld : In function `main`: : (.text+0x1c):undefined refe。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。