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

Joel Sherrill joel at rtems.org
Wed Jan 20 15:29:10 UTC 2016


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

Author:    Ralph Holmes <ralph at ybden.com>
Date:      Wed Jan 20 12:51:39 2016 +0000

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

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 114476	   8176	  25808	 148460	  243ec	base_sp.exe
 135980	   7292	  25664	 168936	  293e8	hello.exe
  48900	   3628	  21168	  73696	  11fe0	minimum.exe
 593388	  80288	  37992	 711668	  adbf4	fileio.exe
 137100	   9992	  25960	 173052	  2a3fc	nsecs.exe
 210124	  20976	  25904	 257004	  3ebec	paranoia.exe
 117948	   8360	  25232	 151540	  24ff4	ticker.exe
 117308	   8384	  28912	 154604	  25bec	unlimited.exe
1068972	  48272	  32688	1149932	 118bec	cxx_iostream.exe
 237188	  19372	  26048	 282608	  44ff0	cdtest.exe
 226092	  22360	  28020	 276472	  437f8	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
 100632	   7484	  26016	 134132	  20bf4	base_sp.exe
 119704	   6588	  25232	 151524	  24fe4	hello.exe
  36232	   2968	  21184	  60384	   ebe0	minimum.exe
 568984	  77192	  37832	 684008	  a6fe8	fileio.exe
 124984	   9260	  25480	 159724	  26fec	nsecs.exe
 195656	  20252	  25744	 241652	  3aff4	paranoia.exe
 105352	   7652	  25216	 138220	  21bec	ticker.exe
 101640	   7664	  28912	 138216	  21be8	unlimited.exe
 557072	  39024	  32624	 628720	  997f0	cxx_iostream.exe
 218540	  17316	  26272	 262128	  3fff0	cdtest.exe
 209704	  21316	  27012	 258032	  3eff0	capture.exe

---

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

diff --git a/c/src/lib/libbsp/mips/csb350/make/custom/csb350.cfg b/c/src/lib/libbsp/mips/csb350/make/custom/csb350.cfg
index 516dc0b..ebadadd 100644
--- a/c/src/lib/libbsp/mips/csb350/make/custom/csb350.cfg
+++ b/c/src/lib/libbsp/mips/csb350/make/custom/csb350.cfg
@@ -15,3 +15,6 @@ CPU_CFLAGS = -mips32 -G0 -msoft-float
 
 # 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