<?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>topic Re: Adding new section to generated .ELD executable (CodeWarrior for StarCore) in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Adding-new-section-to-generated-ELD-executable-CodeWarrior-for/m-p/185925#M4495</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;&amp;nbsp; Did you check the content of the .eld or the content of the .eln file with readelf?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you checked the content of the .eld, the function that are nor used in the application are stripped&lt;/P&gt;&lt;P&gt;&amp;nbsp; out from the executable file by the linker.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Can you give it a try by changing the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - invoke function test inside of main&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - place a #pragma noinline in the beginning of function test to prevent any inlining of the function inside of main.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it working better?&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>Tue, 14 Aug 2012 14:08:41 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2012-08-14T14:08:41Z</dc:date>
    <item>
      <title>Adding new section to generated .ELD executable (CodeWarrior for StarCore)</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Adding-new-section-to-generated-ELD-executable-CodeWarrior-for/m-p/185924#M4494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using CodeWarrior for StarCore 10.2.10. I wanted to place a part of my code in a new section. The CodeWarrior help tells me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="pB_Body"&gt;"The &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;section&lt;/SPAN&gt; attribute lets you place a data object or a function in a specific &lt;SPAN&gt;section&lt;/SPAN&gt;. The syntax is: __attribute__((&lt;SPAN&gt;section&lt;/SPAN&gt;("&lt;SPAN&gt;section&lt;/SPAN&gt;_name"))), where &lt;SPAN&gt;section&lt;/SPAN&gt;_name specifies the target &lt;SPAN&gt;section&lt;/SPAN&gt;'s name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The target &lt;SPAN&gt;section&lt;/SPAN&gt; can be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="pB1_Bullet"&gt;&lt;UL&gt;&lt;LI&gt;a basic &lt;SPAN&gt;section&lt;/SPAN&gt;, such as data, program, bss, rom, or init &lt;SPAN&gt;section&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="pB1_Bullet"&gt;&lt;UL&gt;&lt;LI&gt;a custom &lt;SPAN&gt;section&lt;/SPAN&gt;, defined in the application file&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="pB1_Bullet"&gt;&lt;UL&gt;&lt;LI&gt;a previously undefined &lt;SPAN&gt;section&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="pB_Body"&gt;If the target &lt;SPAN&gt;section&lt;/SPAN&gt; is a previously undefined &lt;SPAN&gt;section&lt;/SPAN&gt;, the compiler creates a &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;section&lt;/SPAN&gt;, and the &lt;SPAN&gt;section&lt;/SPAN&gt; type depends on the current context."&lt;/P&gt;&lt;P class="pB_Body"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="pB_Body"&gt;Here is my code:&lt;/P&gt;&lt;P class="pB_Body"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int test(void) __attribute__ ((section (".my_section")));&lt;BR /&gt;int test(void)&lt;BR /&gt;{&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I examined the generated binary using 'readelf', I could not find any section called '.my_section'. Do I need to do anything else?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2012 06:55:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Adding-new-section-to-generated-ELD-executable-CodeWarrior-for/m-p/185924#M4494</guid>
      <dc:creator>debarati</dc:creator>
      <dc:date>2012-08-04T06:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new section to generated .ELD executable (CodeWarrior for StarCore)</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Adding-new-section-to-generated-ELD-executable-CodeWarrior-for/m-p/185925#M4495</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;&amp;nbsp; Did you check the content of the .eld or the content of the .eln file with readelf?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you checked the content of the .eld, the function that are nor used in the application are stripped&lt;/P&gt;&lt;P&gt;&amp;nbsp; out from the executable file by the linker.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Can you give it a try by changing the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - invoke function test inside of main&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - place a #pragma noinline in the beginning of function test to prevent any inlining of the function inside of main.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it working better?&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>Tue, 14 Aug 2012 14:08:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Adding-new-section-to-generated-ELD-executable-CodeWarrior-for/m-p/185925#M4495</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2012-08-14T14:08:41Z</dc:date>
    </item>
  </channel>
</rss>

