m68k section alignment
Vincent Rivière
vincent.riviere@freesbee.fr
Thu May 17 16:35:00 GMT 2007
Hi.
Currently, gas produces object files for m68k which are aligned to 4
bytes. I think this is too much, because the highest aligment required
for the cpu is 2 bytes.
The attached patch sets the default alignment to 2 bytes for all the
m68k targets.
Thus, the size of the sections in the generated object files are minimal.
$ cat nop.s
nop
$ as-new nop.s -o nop.o
$ objdump -h nop.o
nop.o: file format a.out-m68k-netbsd
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000002 00000000 00000000 00000020 2**1
CONTENTS, ALLOC, LOAD, CODE
1 .data 00000000 00000002 00000002 00000022 2**1
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000002 00000002 00000000 2**1
ALLOC
Note that before this patch, the .text section size was 4-byte long : 2
bytes for the nop, plus 2 filler bytes.
If everyone think it's OK, this patch may be committed.
Regards,
Vincent Rivière
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: alignment.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20070517/c7591e3a/attachment.ksh>
More information about the Binutils
mailing list