<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>section .text make region `FLASH&amp;#39; overflowed (around 14ko)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58571/section-text-make-region-flash-overflowed-around-14ko</link><description>Hello all, 
 
 I try to import Keil project into Eclipse with Makefile. I managed put all my source file to be compiled, and my include paths etc.. in my Makefile 
 In Keil, it compiles without any issue. But my code is too big when compiled through Eclipse</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Mar 2020 14:39:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58571/section-text-make-region-flash-overflowed-around-14ko" /><item><title>RE: section .text make region `FLASH' overflowed (around 14ko)</title><link>https://devzone.nordicsemi.com/thread/237817?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 14:39:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c925e699-26a9-4b7a-b270-9fda2940132a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;By verifying one of the answers, it&amp;#39;ll be tagged with status &amp;quot;verified answer&amp;quot; - ie. closed. Pick one that looks the most informative ;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;H&amp;aring;kon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: section .text make region `FLASH' overflowed (around 14ko)</title><link>https://devzone.nordicsemi.com/thread/237813?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 14:37:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59958e65-5d14-4060-89dd-f1c43669e97c</guid><dc:creator>Ben34</dc:creator><description>&lt;p&gt;NRF_LOG_ENABLE is already 0, thank you for your advice, now I know I have to work on my code itself and not on gcc compilation options :)&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;P.S : how do I set the topic to &amp;quot;solved&amp;quot; or something?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: section .text make region `FLASH' overflowed (around 14ko)</title><link>https://devzone.nordicsemi.com/thread/237797?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 14:05:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:880feea0-60ea-432f-b7ed-91b7b0b2a111</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>[quote user="Ben34"]-Os is very efficient, but it still overflow 2704 bytes. Is there no way to have Keil&amp;#39;s compilation performance in Eclipse? Or at least increase a little bit Eclipse&amp;#39;s one?[/quote]
&lt;p&gt;Different compilers, different behavior and compiled code, unfortunately. Try disabling logging (sdk_config.::NRF_LOG_ENABLED 0) and other modules that you do not need in the application, and see if you can shrink the code size.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: section .text make region `FLASH' overflowed (around 14ko)</title><link>https://devzone.nordicsemi.com/thread/237778?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 13:38:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:221c2634-1ab6-46a7-9ec7-23d8b8602f2d</guid><dc:creator>Ben34</dc:creator><description>&lt;p&gt;Hi, thank you for support :)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Os is very efficient, but it still overflow 2704 bytes. Is there no way to have Keil&amp;#39;s compilation performance in Eclipse? Or at least increase a little bit Eclipse&amp;#39;s one?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you again&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: section .text make region `FLASH' overflowed (around 14ko)</title><link>https://devzone.nordicsemi.com/thread/237706?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 11:55:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47441d09-17af-462c-9770-c4686800cfaa</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Either I put LDFLAG += --library_type=standardlibrary or LDFLAG += --library_type=microlib, it doesn&amp;#39;t change anything. How do I make gcc use microlib library like Keil seems to do ?[/quote]
&lt;p&gt;That is specific to Keil, and gcc will just ignore that. GCC uses newlib nano, as provided with --specs=nano.specs&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are normally two things that shaves off bytes:&lt;/p&gt;
&lt;p&gt;1. garbage collection in the linker (ie: drop unused functions and code)&lt;/p&gt;
&lt;p&gt;2. Changing the optimization level&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You already have GC set in the LDFLAGS:&amp;nbsp;&lt;span&gt;LDFLAGS += -Wl,--gc-sections&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What you can do is try to change your optimization to optimize for size (your current is O2):&lt;/p&gt;
&lt;p&gt;&lt;span&gt;OPT = -Os -g3&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Håkon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>