当输出格式为elf时,请问nasm对文件中的自定义section是怎么处理的?
我简单写了段汇编代码:
[test_section.asm]
-----------------------------
[section .text]
global _start
_start:
mov ax,0
[section .data]
dw 1
[section .d1 noexec]
dw 1
[section .t1]
mov ax,0
------------------------------
linux下输入命令:
nasm -f elf test_section.asm
ld -o test_section test_section.o
readelf -l test_section
输出
------------------------------
Section to Segment mapping:
Segment Sections...
00 .text .d1 .t1
01 .data
----------------------------
看到没有?d1,t1都自动合并到代码段去了,也就是说“在输出的elf文件中,所有自定义段的内容都当作指令来处理,是吗?”
听说在nasm0.98版本里,使不能为elf文件创建自定义段的,只能有elf指定的.bss,.data,.text等若干。现在都version2.08了,nasm是什么处理方式呢?