This is the mail archive of the
mailing list for the binutils project.
Re: ld68k coff again
Le jeudi 04 octobre 2007 à 17:47 +0100, Nick Clifton a écrit :
> Hi Bruno,
> > The size of the sources files and their object files are :
> > dtb00.S : 10 bytes
> > list.S: 4 bytes
> > descr001.S 8 bytes
> > But the size of the linked file is 24 bytes
> > It seems that a word is added by the linker at the end of the linked
> > file and I don't know how to remove it.
> You have run into a limitation of the COFF file format. With COFF all(*)
> sections have a 4 byte alignment, so the output section is padded to a 4 byte
> There are two possible solutions to your problem:
> 1. Switch to a better file format. (Go on, do it. You know that ELF makes
> sense... :-)
Ok. I just try it, and my object files have the right size. In fact, I
just have to had a header to the generated file.
> 2. Hack the assembler and linker so that the default section alignment is
> two bytes instead of four. The attached patch will do this. You will have to
> build and install the assembler and linker of course.
Many thanks again for your help.
> (*) There are a few exceptions, but they have fixed names. You cannot just
> choose the alignment for an arbitrary section.