[rtems commit] m68k/mrm332: Add per-section compilation and linking support.

Joel Sherrill joel at rtems.org
Sat Jan 23 03:11:25 UTC 2016


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

Author:    Ralph Holmes <ralph at ybden.com>
Date:      Sat Jan 23 02:07:35 2016 +0000

m68k/mrm332: Add per-section compilation and linking support.

The size of the sample executables without this option were:

   text    data     bss     dec     hex filename
  78944    1664   17328   97936   17e90 base_sp.exe
  93664    1632   16928  112224   1b660 hello.exe
  25136    1216   13104   39456    9a20 minimum.exe
  98160    1744   17440  117344   1ca60 nsecs.exe
 165888    2032   17920  185840   2d5f0 paranoia.exe
  81648    1664   17360  100672   18940 ticker.exe
  81232    1696   20768  103696   19510 unlimited.exe
 180896    2224   17504  200624   30fb0 cdtest.exe
 166144    2160   19152  187456   2dc40 capture.exe

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

   text	   data	    bss	    dec	    hex	filename
  71456	   1632	  17264	  90352	  160f0	base_sp.exe
  85328	   1584	  16848	 103760	  19550	hello.exe
  18736	   1168	  13056	  32960	   80c0	minimum.exe
  91584	   1712	  17376	 110672	  1b050	nsecs.exe
 158368	   2000	  17856	 178224	  2b830	paranoia.exe
  74816	   1632	  17296	  93744	  16e30	ticker.exe
  73152	   1648	  20688	  95488	  17500	unlimited.exe
 165760	   2112	  17424	 185296	  2d3d0	cdtest.exe
 157040	   2096	  19088	 178224	  2b830	capture.exe

---

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

diff --git a/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332.cfg b/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332.cfg
index de07e73..a0ef592 100644
--- a/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332.cfg
+++ b/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332.cfg
@@ -13,6 +13,9 @@ CPU_CFLAGS = -mcpu=cpu32
 
 # using optimise for size due to small memory on target board.
 CFLAGS_OPTIMIZE_V = -Os -g -fomit-frame-pointer
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 define bsp-post-link
 	$(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec



More information about the vc mailing list