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

Joel Sherrill joel at rtems.org
Thu Jan 21 15:12:35 UTC 2016


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

Author:    Ralph Holmes <ralph at ybden.com>
Date:      Thu Jan 21 14:19:25 2016 +0000

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

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 105752	   7448	  12288	 125488	  1ea30	base_sp.exe
 114212	   6464	  11904	 132580	  205e4	hello.exe
  64844	   4248	   8592	  77684	  12f74	minimum.exe
 568632	  80292	  24664	 673588	  a4734	fileio.exe
 128056	   9936	  12456	 150448	  24bb0	nsecs.exe
 162664	  20132	  12960	 195756	  2fcac	paranoia.exe
 109768	   8300	  12336	 130404	  1fd64	ticker.exe
 109816	   7676	  15728	 133220	  20864	unlimited.exe
1035520	  48120	  19681	1103321	 10d5d9	cxx_iostream.exe
 215960	  18520	  12593	 247073	  3c521	cdtest.exe
 205608	  22188	  14164	 241960	  3b128	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
  93688	   6776	  12216	 112680	  1b828	base_sp.exe
  99720	   5780	  11804	 117304	  1ca38	hello.exe
  40888	   3208	   8496	  52592	   cd70	minimum.exe
 545656	  77224	  24110	 646990	  9df4e	fileio.exe
 117752	   9224	  12304	 139280	  22010	nsecs.exe
 149992	  19428	  12848	 182268	  2c7fc	paranoia.exe
  98968	   7616	  12184	 118768	  1cff0	ticker.exe
  95912	   6976	  15636	 118524	  1cefc	unlimited.exe
 530504	  38896	  18721	 588121	  8f959	cxx_iostream.exe
 199040	  16492	  12517	 228049	  37ad1	cdtest.exe
 190856	  21160	  14000	 226016	  372e0	capture.exe

---

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

diff --git a/c/src/lib/libbsp/mips/rbtx4925/make/custom/rbtx4925.cfg b/c/src/lib/libbsp/mips/rbtx4925/make/custom/rbtx4925.cfg
index d32ffd3..37b1e00 100644
--- a/c/src/lib/libbsp/mips/rbtx4925/make/custom/rbtx4925.cfg
+++ b/c/src/lib/libbsp/mips/rbtx4925/make/custom/rbtx4925.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