AnsweredAssumed Answered

Including a file using the linker on the command line

Question asked by Ben Fleming on Dec 16, 2016
Latest reply on Mar 17, 2017 by stanish

I am trying to use the Coldfire linker on the command line (CodeWarrior 7.1.2). I have an LCF file which includes two binary images, and it links successfully in the IDE. The images have the .gz extension. In the IDE I have file mappings added for .gz, so the linker happily includes them in the final elf.

The situation for the CLI linker is different, however. It instead provides me with this error:

### mwldmcf Linker Error:
# Linker command file error at line 84
# File not found: dsp.coff.gz
### mwldmcf Linker Error:
# Link failed.

Errors caused tool to abort.
make: *** [software.elf] Error 1

 

In my LCF I have this section:

.text :
{
*(.text)
. = ALIGN (0x8);
*(.rodata)
. = ALIGN (0x8);
__start_of_zipped_dsp = .;
INCLUDE dsp.coff.gz
__end_of_zipped_dsp = .;
__start_of_zipped_fpga = .;
INCLUDE fpga.gz
__end_of_zipped_fpga = .;
___ROM_AT = .;
___DATA_ROM = .;
} > code

 

I have tried including the path to the gz files using -Lpath/to/gz/files, which has no effect. Specifying the files as libraries doesn't work, as the linker doesn't understand that it needs to treat them as resources.

As far as I can tell, I need to either rename them to a pre-defined extension, or inform the linker about the .gz extension. This is easy to do in the IDE, but I haven't found mention of how to do it on the CLI. 

Does anyone know if there are any pre-defined resource extensions, or better yet, a way to inform the linker that an extension is a resource?

 

Thanks

-Ben

Outcomes