.section directive documentation out of date?
Nick Clifton
nickc@redhat.com
Thu Mar 24 10:38:00 GMT 2016
Hi Senthil,
> https://sourceware.org/binutils/docs/as/Section.html says that for
> unrecognized section names, the assembler's default behavior is to
> make the section loaded and writable. However, that doesn't seem to
> be the case - for e.g.
>
> $ cat test.s
> .section .fill,"",@progbits
> .byte 0xFF
>
> $ as test.s -o test.o
> $ objdump -h test.o
>
> test.o: file format elf64-x86-64
That part of the description of the .section pseudo-op is for *COFF* based targets
not ELF based ones. The elf64-x86-64 target is ELF based, and so this part of the
description does not apply.
If you run a similar test using a COFF target, you do get the expected results:
$ cd i686-pc-cygwin
$ cat test.s
.section .fill
.byte 0xFF
$ as test.s -o test.o
$ objdump -h test.o
test.o: file format pe-i386
Sections:
Idx Name Size VMA LMA File off Algn
[...]
3 .fill 00000004 00000000 00000000 000000b4 2**2
CONTENTS, ALLOC, LOAD, DATA
Cheers
Nick
More information about the Binutils
mailing list