<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Classic/Legacy CodeWarrior中的主题 Re: Including a file using the linker on the command line</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621182#M7282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben Fleming&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the late reply, How is the status of your issue?&lt;/P&gt;&lt;P&gt;Unfortunately with command line you cannot specify that it needs to treat them as resources, this is something that the compiler need to know to "read the file".&lt;/P&gt;&lt;P&gt;But alternatively you could renamed your .gz file as .bin. Files in *.bin is a pre-defined extension that are treated as resources in&amp;nbsp;CodeWarrior 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Jorge Alcala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Dec 2016 20:20:05 GMT</pubDate>
    <dc:creator>jorge_a_vazquez</dc:creator>
    <dc:date>2016-12-29T20:20:05Z</dc:date>
    <item>
      <title>Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621181#M7281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use the Coldfire linker&amp;nbsp;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&amp;nbsp;file mappings added for .gz, so the linker happily includes them in the final elf.&lt;/P&gt;&lt;P&gt;The situation for the CLI linker is different, however.&amp;nbsp;It instead provides me with this error:&lt;/P&gt;&lt;PRE&gt;### 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&lt;/PRE&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my LCF I have this section:&lt;/P&gt;&lt;PRE&gt;.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 = .;
 } &amp;gt; code&lt;/PRE&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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 &lt;A _jive_internal="true" data-containerid="2031" data-containertype="14" data-objectid="41606" data-objecttype="1" href="https://community.nxp.com/thread/41606" rel="nofollow noopener noreferrer" target="_blank"&gt;easy to do in the IDE&lt;/A&gt;, but I haven't found mention of how to do it on the CLI.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2016 18:04:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621181#M7281</guid>
      <dc:creator>benfleming</dc:creator>
      <dc:date>2016-12-16T18:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621182#M7282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben Fleming&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the late reply, How is the status of your issue?&lt;/P&gt;&lt;P&gt;Unfortunately with command line you cannot specify that it needs to treat them as resources, this is something that the compiler need to know to "read the file".&lt;/P&gt;&lt;P&gt;But alternatively you could renamed your .gz file as .bin. Files in *.bin is a pre-defined extension that are treated as resources in&amp;nbsp;CodeWarrior 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Jorge Alcala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2016 20:20:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621182#M7282</guid>
      <dc:creator>jorge_a_vazquez</dc:creator>
      <dc:date>2016-12-29T20:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621183#M7283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried this, renaming them to bin files, but the linker still complains that it cannot find them. Oddly, I have also tried renaming them to .o, expecting to get a 'cannot parse' type error instead, but I still get a file-not-found error. I&amp;nbsp;have added the path to the libraries using the -L option, but it seems to have no effect either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2016 18:46:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621183#M7283</guid>
      <dc:creator>benfleming</dc:creator>
      <dc:date>2016-12-30T18:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621184#M7284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you possibly try to pass the binary file(s) to linker using an absolute path?&lt;/P&gt;&lt;P&gt;Does it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 17:45:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621184#M7284</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2017-02-07T17:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621185#M7285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure it's possible to enter a path after INCLUDE in the linker control file. I've tried both absolute and relative paths there, with and without surrounding double-quotes, and from the error messages it appears the linker is not expecting a path. Then again, there could be some other way to enter a path that I don't know about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2017 20:02:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621185#M7285</guid>
      <dc:creator>benfleming</dc:creator>
      <dc:date>2017-02-09T20:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621186#M7286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are building your project from CLI you should pass the binary files as an input files for linker (same as e.g. object files) e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mwldmcf.exe [&lt;SPAN&gt;linker_flags&lt;/SPAN&gt;] file1.o file2.o binary_file1.bin binary_file2.bin ….&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;-o &lt;SPAN&gt;Out.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so if it does not work I'd suggest to try to enter absolute path to figure out if it's a path issue or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mwldmcf.exe [&lt;SPAN&gt;linker_flags&lt;/SPAN&gt;] file1.o file2.o c:\My_Project\bin\binary_file1.bin c:\My_Project\bin\binary_file2.bin ….&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;-o &lt;SPAN&gt;Out.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 15:51:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621186#M7286</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2017-02-10T15:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621187#M7287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was it - the input files were not specified on the command line. Somehow from the documentation I incorrectly understood they needed to be included like library paths.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm running into an issue where the linker complains it cannot find symbols defined in my .lcf:&lt;/P&gt;&lt;PRE&gt;### mwldmcf Linker:
# 40: Referenced from "fbcs_init" in 
# Error: ^
# Undefined : "__FLASH0_ADDRESS"&lt;/PRE&gt;&lt;P&gt;and in my .lcf:&lt;/P&gt;&lt;PRE&gt;SECTIONS
{

 ___FLASH0_ADDRESS = 0x00000000;
 ___FLASH0_SIZE = 0x01000000;
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 23:03:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621187#M7287</guid>
      <dc:creator>benfleming</dc:creator>
      <dc:date>2017-03-15T23:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621188#M7288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the update.&lt;/P&gt;&lt;P&gt;Could you please check you correctly imported these linker symbols into the appropriate .c/.h files:&lt;/P&gt;&lt;P&gt;extern long ___FLASH0_ADDRESS;&lt;/P&gt;&lt;P&gt;extern long ___FLASH0_SIZE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 14:15:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621188#M7288</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2017-03-16T14:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621189#M7289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The .lcf and code base were correctly compiling from the IDE. The linker symbols were imported as such:&lt;/P&gt;&lt;PRE&gt;extern uint8&amp;nbsp;__FLASH0_ADDRESS[];
extern uint8 __FLASH0_SIZE[];&lt;/PRE&gt;&lt;P&gt;(two underscores) - this works fine when linking from the IDE; it appears that the compiler prepends a single underscore to every symbol. Again, this doesn't work when linking from the CLI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried them with 3 underscores:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;extern &lt;/SPAN&gt;&lt;SPAN&gt;uint8&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;___FLASH0_ADDRESS[];&lt;/SPAN&gt;
&lt;SPAN&gt;extern uint8 ___FLASH0_SIZE[];&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;and also imported as long, with three underscores:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;extern &lt;SPAN&gt;long&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;___FLASH0_ADDRESS[];&lt;/SPAN&gt;
&lt;SPAN&gt;extern long&amp;nbsp;___FLASH0_SIZE[];&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;and in both cases I still got&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN&gt;# 40: Referenced from "fbcs_init" in 
# Error: ^
# Undefined : "___FLASH0_ADDRESS"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 15:43:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621189#M7289</guid>
      <dc:creator>benfleming</dc:creator>
      <dc:date>2017-03-16T15:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621190#M7290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never mind. I was getting these errors because at some point I fat-fingered the linker command in my makefile in such a way that it caused my LCF to be excluded from the command line.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:47:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621190#M7290</guid>
      <dc:creator>benfleming</dc:creator>
      <dc:date>2017-03-16T16:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Including a file using the linker on the command line</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621191#M7291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ben,&lt;/P&gt;&lt;P&gt;thanks for sharing the resolution with us.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 08:40:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Including-a-file-using-the-linker-on-the-command-line/m-p/621191#M7291</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2017-03-17T08:40:16Z</dc:date>
    </item>
  </channel>
</rss>

