<?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>CodeWarrior for MCUのトピックDuplicate string literals in final binary -- compiler optimization to &amp;quot;Reuse Strings&amp;quot;?</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217988#M8632</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Browsing through the MAP file for my project, I saw that it contained multiple copies of some string literals (in my case "0123456789abcdef", used in multiple debug locations to dump byte arrays, and even the empty string "").&amp;nbsp; I searched quite a bit for a compiler option similar to the "Reuse Strings" option for the Coldfire compiler, but to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there some way to get the compiler to only link one copy of the string literal into the final binary?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that I can create a constant char array, but that creates a dependency from these unrelated functions that I use on other platforms.&amp;nbsp; I'm surprised that a compiler for such a resource-constrained target wouldn't consolidate string literals as much as possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Aug 2010 06:15:10 GMT</pubDate>
    <dc:creator>tomlogic</dc:creator>
    <dc:date>2010-08-13T06:15:10Z</dc:date>
    <item>
      <title>Duplicate string literals in final binary -- compiler optimization to "Reuse Strings"?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217988#M8632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Browsing through the MAP file for my project, I saw that it contained multiple copies of some string literals (in my case "0123456789abcdef", used in multiple debug locations to dump byte arrays, and even the empty string "").&amp;nbsp; I searched quite a bit for a compiler option similar to the "Reuse Strings" option for the Coldfire compiler, but to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there some way to get the compiler to only link one copy of the string literal into the final binary?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that I can create a constant char array, but that creates a dependency from these unrelated functions that I use on other platforms.&amp;nbsp; I'm surprised that a compiler for such a resource-constrained target wouldn't consolidate string literals as much as possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 06:15:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217988#M8632</guid>
      <dc:creator>tomlogic</dc:creator>
      <dc:date>2010-08-13T06:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate string literals in final binary -- compiler optimization to "Reuse Strings"?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217989#M8633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Additional info: HC08, CodeWarrior 5.9.0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 09:05:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217989#M8633</guid>
      <dc:creator>tomlogic</dc:creator>
      <dc:date>2010-08-13T09:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate string literals in final binary -- compiler optimization to "Reuse Strings"?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217990#M8634</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;I don't quite understand your dependency argument with respect to "unrelated functions".&amp;nbsp; I&amp;nbsp;might assume a globally defined const char array, to be accessible to any function that required its use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 12:47:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217990#M8634</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-08-13T12:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate string literals in final binary -- compiler optimization to "Reuse Strings"?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217991#M8635</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;Did you look at linker option -Cocc?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This one seems to be doing what&amp;nbsp; you are trying to achieve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 16:49:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217991#M8635</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2010-08-13T16:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate string literals in final binary -- compiler optimization to "Reuse Strings"?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217992#M8636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's exactly what I needed.&amp;nbsp; I guess I overlooked that option when I was looking at the linker options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 23:17:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Duplicate-string-literals-in-final-binary-compiler-optimization/m-p/217992#M8636</guid>
      <dc:creator>tomlogic</dc:creator>
      <dc:date>2010-08-13T23:17:40Z</dc:date>
    </item>
  </channel>
</rss>

