<?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のトピックPowerpc ROM to RAM linker question.</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183629#M4331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying to do something I thought was very simple, have the .data segment load address placed in ROM, but the execution address in RAM. I've done a slightly modified script from the examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not using the all the __start, __init_hardware, etc things, instead I have adpated the script to the old way of doing things (for me anyway), ie code that copies from address __DATA_ROM to __DATA_RAM with size __DATA_RAM - __DATA_END.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is attempting to place the load address of .data in flash, and the execution address of .data in sram.&lt;/P&gt;&lt;P&gt;My problem is however that the linker seems to ignore the "LOAD(ADDR(__DATA_ROM))" part of the script. Loading the .elf will place data directly into the execution address. I had expected the __DATA_ROM to be loaded with the .data section.&lt;BR /&gt;&lt;BR /&gt;So, to my questions&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I'm I misunderstanding the way LOAD() works?&lt;/LI&gt;&lt;LI&gt;Used to ld (binutils) so I started looking in the lines of "section : { *(.data) } &amp;gt; ram AT&amp;gt; sram" and found&amp;nbsp; "sectionName : [AT (loadAddress)] {contents} &amp;gt; segmentName", page 206 in the "CodeWarrior Development Studio for Power Architecture® Processors Build Tools Reference". However, I've tried every possible way to get the linker to accept the AT but it just complains that it expects a "{". So, is this at all supported? (documention problem?)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;/M&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Feb 2011 05:34:01 GMT</pubDate>
    <dc:creator>MartenH</dc:creator>
    <dc:date>2011-02-16T05:34:01Z</dc:date>
    <item>
      <title>Powerpc ROM to RAM linker question.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183629#M4331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying to do something I thought was very simple, have the .data segment load address placed in ROM, but the execution address in RAM. I've done a slightly modified script from the examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not using the all the __start, __init_hardware, etc things, instead I have adpated the script to the old way of doing things (for me anyway), ie code that copies from address __DATA_ROM to __DATA_RAM with size __DATA_RAM - __DATA_END.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is attempting to place the load address of .data in flash, and the execution address of .data in sram.&lt;/P&gt;&lt;P&gt;My problem is however that the linker seems to ignore the "LOAD(ADDR(__DATA_ROM))" part of the script. Loading the .elf will place data directly into the execution address. I had expected the __DATA_ROM to be loaded with the .data section.&lt;BR /&gt;&lt;BR /&gt;So, to my questions&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I'm I misunderstanding the way LOAD() works?&lt;/LI&gt;&lt;LI&gt;Used to ld (binutils) so I started looking in the lines of "section : { *(.data) } &amp;gt; ram AT&amp;gt; sram" and found&amp;nbsp; "sectionName : [AT (loadAddress)] {contents} &amp;gt; segmentName", page 206 in the "CodeWarrior Development Studio for Power Architecture® Processors Build Tools Reference". However, I've tried every possible way to get the linker to accept the AT but it just complains that it expects a "{". So, is this at all supported? (documention problem?)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;/M&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Feb 2011 05:34:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183629#M4331</guid>
      <dc:creator>MartenH</dc:creator>
      <dc:date>2011-02-16T05:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Powerpc ROM to RAM linker question.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183630#M4332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to my understanding you want to get initialization value for global variable allocated in flash and copied over to RAM at start up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is what you intend to do, make sure to generate a ROM Image for your application.&lt;/P&gt;&lt;P&gt;In this purpose you need to check &lt;STRONG&gt;Generate ROM Image&lt;/STRONG&gt; in &lt;EM&gt;&lt;STRONG&gt;EPPC Linker&lt;/STRONG&gt;&lt;/EM&gt; panel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have created your project using&amp;nbsp;the wizard, the ROM Version build target has the appropriate settings.&lt;/P&gt;&lt;P&gt;Note that you will need to invoke the function&amp;nbsp;&lt;FONT size="2"&gt;__init_data implemented in __start.c to set the variables to their initialization value (i.e. copy values from ROM to RAM).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Feb 2011 16:17:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183630#M4332</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2011-02-16T16:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Powerpc ROM to RAM linker question.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183631#M4333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CC00"&gt;According to my understanding you want to get initialization value for global variable allocated in flash and copied over to RAM at start up.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CC00"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CC00"&gt;Am I right?&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;Yes&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CC00"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CC00"&gt;If this is what you intend to do, make sure to generate a ROM Image for your application.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CC00"&gt;In this purpose you need to check &lt;STRONG&gt;Generate ROM Image&lt;/STRONG&gt; in &lt;EM&gt;&lt;STRONG&gt;EPPC Linker&lt;/STRONG&gt;&lt;/EM&gt; panel.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I was not clear in my previous post. I do not use the ColdWarrior&amp;nbsp;IDE at all, just the command line tools. The reason for not using __start is that I support mulitple compilers in my environment and I want to keep linkfiles and startup code as common as possible.&amp;nbsp; Does the "Generate ROM Image in EPPC Linker panel" set any options to the linker?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Cheers,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;/M&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Feb 2011 17:33:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183631#M4333</guid>
      <dc:creator>MartenH</dc:creator>
      <dc:date>2011-02-16T17:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Powerpc ROM to RAM linker question.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183632#M4334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look at options &amp;nbsp;-romaddr &amp;amp; -rambuffer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But you will need to add a function which is actually initializing the global data to your application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Implementation of this function is linker specific, so you cannot keep it generic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Feb 2011 18:51:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183632#M4334</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2011-02-16T18:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Powerpc ROM to RAM linker question.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183633#M4335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, the options did the trick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 05:36:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Powerpc-ROM-to-RAM-linker-question/m-p/183633#M4335</guid>
      <dc:creator>MartenH</dc:creator>
      <dc:date>2011-02-17T05:36:46Z</dc:date>
    </item>
  </channel>
</rss>

