[PATCH 20/32] m32c/m32csim: Add per-section compilation and linking support

Joel Sherrill joel at rtems.org
Fri Mar 11 00:15:25 UTC 2016


updates #2577.

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

   text	   data	    bss	    	  dec	    	  hex	filename
 143148	   1118	   4664	 148930	  245c2	ticker.exe
  55140	    584	    876	  56600	   dd18	minimum.exe
 268638	   1804	   6598	 277040	  43a30	capture.exe
 161226	   1184	   4712	 167122	  28cd2	nsecs.exe
 389500	   1518	   5176	 396194	  60ba2	paranoia.exe
 135256	   1118	   4638	 141012	  226d4	base_sp.exe
 139728	   1146	   6482	 147356	  23f9c	unlimited.exe
 165500	   1092	   4638	 171230	  29cde	hello.exe

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

   text	   data	    bss	    	  dec	    	  hex	filename
 137586	   1096	   4526	 143208	  22f68	ticker.exe
  31136	    454	    738	  32328	   7e48	minimum.exe
 252540	   1764	   6458	 260762	  3fa9a	capture.exe
 155716	   1162	   4570	 161448	  276a8	nsecs.exe
 378606	   1492	   5038	 385136	  5e070	paranoia.exe
 124526	   1092	   4500	 130118	  1fc46	base_sp.exe
 128746	   1120	   6344	 136210	  21412	unlimited.exe
 154278	   1066	   4500	 159844	  27064	hello.exe
---
 c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg b/c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg
index cee695d..491f000 100644
--- a/c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg
+++ b/c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg
@@ -15,3 +15,6 @@ CPU_CFLAGS = -mcpu=m32cm
 # see GCC PR37665
 #CFLAGS_OPTIMIZE_V = -Os -g
 CFLAGS_OPTIMIZE_V = -O0 -g
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
-- 
1.8.3.1




More information about the devel mailing list