[rtems commit] sh/gensh1: 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:    fd9ea74c93490cfd38490a7a12d4655d67349f65
Changeset: http://git.rtems.org/rtems/commit/?id=fd9ea74c93490cfd38490a7a12d4655d67349f65

Author:    Joel Sherrill <joel at rtems.org>
Date:      Thu Mar 10 16:46:02 2016 -0600

sh/gensh1: Add per-section compilation and linking support

updates #2577.

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

   text	   data	    bss	    	  dec	    	  hex	filename
  63586	   7626	   6788	  78000	  130b0	ticker.exe
  25042	   3170	   2872	  31084	   796c	minimum.exe
 337626	  47818	  36260	 421704	  66f48	pppd.exe
 141298	  20114	   9684	 171096	  29c58	capture.exe
  76738	   8038	   6865	  91641	  165f9	nsecs.exe
 130658	  18522	   7356	 156536	  26378	paranoia.exe
 144274	  22874	   7844	 174992	  2ab90	cdtest.exe
  60802	   6810	   6756	  74368	  12280	base_sp.exe
  63138	   7046	  10580	  80764	  13b7c	unlimited.exe
  77074	   5402	   6748	  89224	  15c88	hello.exe
 201686	  19922	  14084	 235692	  398ac	loopback.exe

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

   text	   data	    bss	    	  dec	    	  hex	filename
  59298	   7054	   6760	  73112	  11d98	ticker.exe
  13490	   1502	   1844	  16836	   41c4	minimum.exe
 298274	  40526	  35440	 374240	  5b5e0	pppd.exe
 133634	  19278	   9664	 162576	  27b10	capture.exe
  73106	   7446	   6841	  87393	  15561	nsecs.exe
 124562	  17926	   7320	 149808	  24930	paranoia.exe
 138738	  12026	   7820	 158584	  26b78	cdtest.exe
  55218	   6234	   6732	  68184	  10a58	base_sp.exe
  53474	   5422	   9524	  68420	  10b44	unlimited.exe
  66898	   3766	   5688	  76352	  12a40	hello.exe
 179362	  14206	  13924	 207492	  32a84	loopback.exe

---

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

diff --git a/c/src/lib/libbsp/sh/gensh1/make/custom/gensh1.cfg b/c/src/lib/libbsp/sh/gensh1/make/custom/gensh1.cfg
index 4f80115..fb066ed 100644
--- a/c/src/lib/libbsp/sh/gensh1/make/custom/gensh1.cfg
+++ b/c/src/lib/libbsp/sh/gensh1/make/custom/gensh1.cfg
@@ -18,3 +18,6 @@ CPU_CFLAGS = -m1
 
 # optimize flag: typically -O2
 CFLAGS_OPTIMIZE_V = -O2 -g 
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections




More information about the vc mailing list