<?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: Linker script (.lcf): placing sections of object files from a library (Kinetis)</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-script-lcf-placing-sections-of-object-files-from-a/m-p/206335#M5747</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answering myself,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the linker has the &lt;A href="http://www.freescale.com/infocenter/topic/com.freescale.doc.mcu.Kinetis_compiler/doc/050_ELFLinker.Specifying_Files_and_Functions.html" rel="nofollow noopener noreferrer" target="_blank"&gt;OBJECT&lt;/A&gt; directive to place single objects (functions, variables):&lt;/P&gt;&lt;PRE&gt;.early_code :  {    OBJECT(_my_init_function, libBlaBlub.a)  } &amp;gt; rom&lt;/PRE&gt;&lt;P&gt;I can thus enumerate all the early-boot functions instead of their compilation units. Works for me. Instead of "bla.c", as the doc says, I use "bla.obj" or if it's in a library, "libWhateverLibrary.a".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2012 15:16:41 GMT</pubDate>
    <dc:creator>konrada</dc:creator>
    <dc:date>2012-03-27T15:16:41Z</dc:date>
    <item>
      <title>Linker script (.lcf): placing sections of object files from a library (Kinetis)</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-script-lcf-placing-sections-of-object-files-from-a/m-p/206334#M5746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my application used to fit into the internal flash of my K70 board, but now it has grown so that I have to use external Flash and external RAM. As an intermediate step, I want to get the copying of code to work from internal Flash to external RAM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using CW 10.2 for MCU. I have identified the five compilation units which contribute the code which runs before external RAM is ready for copying, and I want to use the linker script to place them in a section which executes from ROM, and the remaining code in a section which executes from RAM.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My lcf looks like the following (grossly simplified):&lt;/P&gt;&lt;PRE&gt;MEMORY{&amp;nbsp; rom (RX): ORIGIN = 0x00000420, LENGTH=0x000FFBE0&amp;nbsp; extram (RW): ORIGIN = 0x80000000, LENGTH=0x01000000}SECTIONS{&amp;nbsp; .early_code :&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; cw.obj(.text)&amp;nbsp;&amp;nbsp;&amp;nbsp; __arm_eabi_init.obj(.text)&amp;nbsp; } &amp;gt; rom&amp;nbsp; .main_application :&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.text)&amp;nbsp; } &amp;gt;&amp;gt; rom}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;When the object files for .early_code reside in the application, this works fine. However, when I try to place the code from cw.obj (from my BSP library) or __arm_eabi_init.obj (from some CW library) that way, the compiler complains that it cannot find the files cw.obj and __arm_eabi_init.obj.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Linker command file error at line xx File not found: cw.obj"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using the names "cw.o" (like in the linker map file) and "cw.c" (like in the online help), with no improvements. Is there special syntax for placing files from libraries?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 16:18:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-script-lcf-placing-sections-of-object-files-from-a/m-p/206334#M5746</guid>
      <dc:creator>konrada</dc:creator>
      <dc:date>2012-02-15T16:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Linker script (.lcf): placing sections of object files from a library (Kinetis)</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-script-lcf-placing-sections-of-object-files-from-a/m-p/206335#M5747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answering myself,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the linker has the &lt;A href="http://www.freescale.com/infocenter/topic/com.freescale.doc.mcu.Kinetis_compiler/doc/050_ELFLinker.Specifying_Files_and_Functions.html" rel="nofollow noopener noreferrer" target="_blank"&gt;OBJECT&lt;/A&gt; directive to place single objects (functions, variables):&lt;/P&gt;&lt;PRE&gt;.early_code :  {    OBJECT(_my_init_function, libBlaBlub.a)  } &amp;gt; rom&lt;/PRE&gt;&lt;P&gt;I can thus enumerate all the early-boot functions instead of their compilation units. Works for me. Instead of "bla.c", as the doc says, I use "bla.obj" or if it's in a library, "libWhateverLibrary.a".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 15:16:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-script-lcf-placing-sections-of-object-files-from-a/m-p/206335#M5747</guid>
      <dc:creator>konrada</dc:creator>
      <dc:date>2012-03-27T15:16:41Z</dc:date>
    </item>
  </channel>
</rss>

