ld for coff-m68k

Nick Clifton nickc@redhat.com
Tue Oct 2 10:56:00 GMT 2007


Hi Bruno,

> If you have a look in the map file
> 
> Two bytes are added by the linker after the declaration of DATA_B
> (*fill*). It is these two bytes that I want to "remove"

Understood.  So the reason that the bytes are being inserted is that the .data 
section in the list.o file has a 4-byte alignment requirement.  (Try running 
"objdump -h list.o" to see this).  You can tell the linker to ignore the 
alignment requirements of input sections however and instead use your own 
alignment specification by using the SUBALIGN linker script directive.  So if 
you change the link_command script so that the data output section looks like this:

         data 0 : SUBALIGN(2) { *.data }

and then link your executable you should get the desired results.  (You do not 
need to add -N or -n to the linker command line).

Cheers
   Nick



More information about the Binutils mailing list