This is the mail archive of the binutils@sources.redhat.com 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]

objcopy interleave address bug ?


Hi,

While creating a binutils port for the CR16C processor, I saw a difference in
objcopy's output with the interleaved output option (-i -b flags), compared to
the behavior of National Semiconductor's proprietary parallel tool, and I think
it may be a conceptual bug in objcopy:

Let's say objcopy is first invoked as follows (the example is for S-records,
but the situation is the same for other formats as well):

objcopy -O srec a.out interleave
objcopy -O srec -i2 -b0 a.out interleave.0
objcopy -O srec -i2 -b1 a.out interleave.1

And let's say interleave has the following S-record:

S31500000010000102030405060708090A0B0C0D0E0F<checksum>
S31500000020101112131415161718191A1B1C1D1E1F<checksum>

Then interleave.0 will have:

S3150000001000020406080A0C0E10121416181A1C1E<checksum>

And interleave.1 will have:

S3150000001001030507090B0D0F11131517191B1D1F<checksum>

I.e., the load address of the first byte of each interleaved block
is the same as its load address in the non-interleaved output, rounded to
the interleave-block-size). Our proprietary tool would output as an address
the value of the original address divided by the interleave block size,
i.e.

interleave.0 would have:

S3150000000800020406080A0C0E10121416181A1C1E<checksum>
          ^^ 


And interleave.1 would have:

S3150000000801030507090B0D0F11131517191B1D1F<checksum>
          ^^

This seems to be the "logical" thing to do, at least for formats
which are used for loading executables onto memory devices of embedded
systems, since interleaved output files are each loaded onto a separate
device, and these devices are concatanated, and so the contents of address x
in the original object would be placed in address x divided by
interleave-block-size in e.g. the first device.

Do you agree ?

Regards,
Galit.


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