[rtems commit] mips/hurricane: Add per-section compilation and linking support.

Joel Sherrill joel at rtems.org
Wed Jan 20 22:51:11 UTC 2016


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

Author:    Ralph Holmes <ralph at ybden.com>
Date:      Wed Jan 20 20:48:55 2016 +0000

mips/hurricane: Add per-section compilation and linking support.

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 107080	   7480	  11888	 126448	  1edf0	base_sp.exe
 114164	   6464	  11440	 132068	  203e4	hello.exe
  64796	   4248	   8192	  77236	  12db4	minimum.exe
 569960	  80320	  24264	 674544	  a4af0	fileio.exe
 129384	   9968	  12056	 151408	  24f70	nsecs.exe
 163992	  20160	  12560	 196712	  30068	paranoia.exe
 111096	   8332	  11936	 131364	  20124	ticker.exe
 109768	   7676	  15328	 132772	  206a4	unlimited.exe
1035472	  48120	  19281	1102873	 10d419	cxx_iostream.exe
 217288	  18556	  12193	 248037	  3c8e5	cdtest.exe
 206936	  22216	  13780	 242932	  3b4f4	capture.exe

The size of the sample executables with this option enabled were:

   text	   data	    bss	    dec	    hex	filename
  95016	   6808	  11748	 113572	  1bba4	base_sp.exe
  99688	   5780	  11384	 116852	  1c874	hello.exe
  40856	   3208	   8076	  52140	   cbac	minimum.exe
 546984	  77256	  23706	 647946	  9e30a	fileio.exe
 119080	   9256	  11900	 140236	  223cc	nsecs.exe
 151320	  19460	  12444	 183224	  2cbb8	paranoia.exe
 100296	   7648	  11780	 119724	  1d3ac	ticker.exe
  95880	   6976	  15216	 118072	  1cd38	unlimited.exe
 530472	  38896	  18365	 587733	  8f7d5	cxx_iostream.exe
 200368	  16524	  12113	 229005	  37e8d	cdtest.exe
 192184	  21192	  13596	 226972	  3769c	capture.exe

---

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

diff --git a/c/src/lib/libbsp/mips/hurricane/make/custom/hurricane.cfg b/c/src/lib/libbsp/mips/hurricane/make/custom/hurricane.cfg
index 68fe719..02d198b 100644
--- a/c/src/lib/libbsp/mips/hurricane/make/custom/hurricane.cfg
+++ b/c/src/lib/libbsp/mips/hurricane/make/custom/hurricane.cfg
@@ -12,6 +12,9 @@ CPU_CFLAGS = -mips3 -G0 -EL
 
 # optimize flag: typically -O2
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 define bsp-post-link
 	$(OBJCOPY) -O srec $@ $(basename $@).srec1




More information about the vc mailing list