I am porting code from a codewarrior 6.3 project to 10.6. I have assembly code that defines a section of rodata that needs to be put in a defined linker section. This works great in 6.3, but not in 10.6. Target is Coldfire V1 MCF51JE256RM
I have an assembly section defined like so:
.section BooksRange, rodata
mnJAN: .word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0101
Then in the linker file I have:
.text3 :
{
__START_booksRange = .;
*(.BooksRange)
. = ALIGN(4);
__END_booksRange = .;
} >> code2
This gives me the error: "BooksRange(BooksRange) in file bits_asm.obj is referenced but has not been written. Check your linker command file." And I checked, the data is not in any output binary file.
------------------------------------------------------------------------------------------------------------------
In 6.3 the linker file is the same except for one difference. The *(.BooksRange) line is "*(BooksRange)" with no ".". In 10.6, if there is no "." the linker thinks there is no section defined and puts the data with the rest of the .rodata.
How do you link to a section defined in assembly in Codewarrior 10.6? Why is it not writing the data to the binary files?
So it turns out that this was the correct syntax: Without the "." to match the section name in assembly.
.text3 :
{
__START_booksRange = .;
*(BooksRange)
. = ALIGN(4);
__END_booksRange = .;
} >> code2
It was putting the data in the correct locations in the .s19 files. There are two different binaries that codwarrior creates, "Binary Image" and "Raw Binary Image". I was looking at the "Binary Image" which I do not know why is there. But I think the "Raw Binary Image" is the one I need to look at to make sure data is in the correct place?
BUT, i'm getting an error when this is being generated:
"Maximum raw-binary gap (0x00010000) exceeded between addresses 0x000005F2-0x000005F0. Dropping raw-binary file generation"
What is the difference between the two binary images and what does this error mean?
Hi Matt,
When generating a raw binary image the addresses that are not defined as part of the application will be filled with 0x00 in the image. The gap between defined addresses should not exceed the maximum gap which can be configured in Tool Settings - ColdFire Linker > Output Options > Max Raw-Binary Gap. If this gap is exceeded the raw binary file generation is dropped.
About the differences beetween the Binary and Raw binary images, the Binary image will generate a binary version of the .s19 file and the Raw-Binary image will generate a pure binary image.
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer