[rtems commit] lm32/lm32_evr: Add per-section compilation and linking support

Joel Sherrill joel at rtems.org
Fri Mar 11 20:14:54 UTC 2016


Module:    rtems
Branch:    master
Commit:    f953a85ace6d96d85fbe3d6faef56b94bf909e24
Changeset: http://git.rtems.org/rtems/commit/?id=f953a85ace6d96d85fbe3d6faef56b94bf909e24

Author:    Joel Sherrill <joel at rtems.org>
Date:      Thu Mar 10 15:58:08 2016 -0600

lm32/lm32_evr: Add per-section compilation and linking support

updates #2577.

For the lm32_evr BSP variant without this option sample executables
sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
 195764	   6892	  13077	 215733	  34ab5	ticker.exe
  84212	   2264	   9169	  95645	  1759d	minimum.exe
1077108	  82852	  26293	1186253	 1219cd	fileio.exe
 763500	  56340	  44493	 864333	  d304d	pppd.exe
 344948	  22148	  15977	 383073	  5d861	capture.exe
 211876	   8472	  13169	 233517	  3902d	nsecs.exe
 330020	  18636	  13685	 362341	  58765	paranoia.exe
 185956	   6452	  13053	 205461	  32295	base_sp.exe
 194516	   6656	  16893	 218065	  353d1	unlimited.exe
 202164	   5400	  13013	 220577	  35da1	hello.exe
 474728	  23220	  20389	 518337	  7e8c1	loopback.exe

For the lm32_evr BSP variant with this option sample executables
sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
 186388	   6792	  13045	 206225	  32591	ticker.exe
  53140	   1124	   9137	  63401	   f7a9	minimum.exe
1049556	  80336	  26045	1155937	 11a361	fileio.exe
 685632	  55056	  43757	 784445	  bf83d	pppd.exe
 323588	  21400	  15953	 360941	  581ed	capture.exe
 203540	   8352	  13137	 225029	  36f05	nsecs.exe
 316612	  18512	  13653	 348777	  55269	paranoia.exe
 172724	   6352	  13021	 192097	  2ee61	base_sp.exe
 176708	   6528	  16837	 200073	  30d89	unlimited.exe
 182900	   5260	  13021	 201181	  311dd	hello.exe
 436064	  22840	  20293	 479197	  74fdd	loopback.exe

---

 c/src/lib/libbsp/lm32/lm32_evr/make/custom/lm32_evr.cfg | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/c/src/lib/libbsp/lm32/lm32_evr/make/custom/lm32_evr.cfg b/c/src/lib/libbsp/lm32/lm32_evr/make/custom/lm32_evr.cfg
index c1951d0..c26a628 100644
--- a/c/src/lib/libbsp/lm32/lm32_evr/make/custom/lm32_evr.cfg
+++ b/c/src/lib/libbsp/lm32/lm32_evr/make/custom/lm32_evr.cfg
@@ -19,6 +19,9 @@ CPU_CFLAGS =
 # optimize flag: typically -O2
 # ATM, doesn't work with optimization levels > 0
 CFLAGS_OPTIMIZE_V = -O0 -g
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 define bsp-post-link
 	$(OBJCOPY) -O binary --strip-all $(basename $@)$(EXEEXT) \



More information about the vc mailing list