This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld for coff-m68k


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]