现在位置: 首页 > location counter
2018年05月10日 常见问题 ⁄ 共 1271字 GNU LD 链接器脚本中 location counter 到底是怎样改变的?已关闭评论 ⁄ 阅读 1,739 次
本文内容无意间搜到,正好之前也有这个困惑,所以转来做个备份: 引入问题; 我写了一个简单的汇编语言例程,text.s section .text .globl _start _start: movq $1, %rax movq $0, %rbx int $0x80 用下面的ld脚本test.lds进行链接 SECTIONS { . = 0x10; label_1 = .; custom_section : { . = 0x20; label_2 = . ; label_3 = ABSOLUTE(.) ; *(.text) ; } } 链接命令为: as test.c...
阅读全文
×