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

Joel Sherrill joel at rtems.org
Thu Jan 21 21:50:57 UTC 2016


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

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

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

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 105928	   7448	  12304	 125680	  1eaf0	base_sp.exe
 114276	   6464	  11904	 132644	  20624	hello.exe
  64908	   4248	   8592	  77748	  12fb4	minimum.exe
 568808	  80292	  24680	 673780	  a47f4	fileio.exe
 128232	   9936	  12472	 150640	  24c70	nsecs.exe
 162840	  20132	  12976	 195948	  2fd6c	paranoia.exe
 109944	   8300	  12352	 130596	  1fe24	ticker.exe
 109880	   7676	  15728	 133284	  208a4	unlimited.exe
1035584	  48120	  19681	1103385	 10d619	cxx_iostream.exe
 216136	  18520	  12609	 247265	  3c5e1	cdtest.exe
 205784	  22188	  14180	 242152	  3b1e8	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
  93464	   6776	  12188	 112428	  1b72c	base_sp.exe
  99480	   5780	  11788	 117048	  1c938	hello.exe
  40616	   3208	   8512	  52336	   cc70	minimum.exe
 545448	  77224	  24130	 646802	  9de92	fileio.exe
 117528	   9224	  12340	 139092	  21f54	nsecs.exe
 149784	  19428	  12804	 182016	  2c700	paranoia.exe
  98760	   7616	  12204	 118580	  1cf34	ticker.exe
  95672	   6976	  15620	 118268	  1cdfc	unlimited.exe
 530280	  38896	  18753	 587929	  8f899	cxx_iostream.exe
 198832	  16492	  12473	 227797	  379d5	cdtest.exe
 190632	  21160	  14036	 225828	  37224	capture.exe

---

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

diff --git a/c/src/lib/libbsp/mips/rbtx4938/make/custom/rbtx4938.cfg b/c/src/lib/libbsp/mips/rbtx4938/make/custom/rbtx4938.cfg
index aa4b542..a60a8c6 100644
--- a/c/src/lib/libbsp/mips/rbtx4938/make/custom/rbtx4938.cfg
+++ b/c/src/lib/libbsp/mips/rbtx4938/make/custom/rbtx4938.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) --srec-len=30 -O srec $@ $(basename $@)$(DOWNEXT)




More information about the vc mailing list