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

Joel Sherrill joel at rtems.org
Sat Jan 23 03:42:30 UTC 2016


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

Author:    Ralph Holmes <ralph at ybden.com>
Date:      Sat Jan 23 03:33:52 2016 +0000

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

For the COBRA5475 BSP variant:

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
  92068	   1684	134123976   134217728	8000000	base_sp.exe
 100414	   1656	134115656   134217726	7fffffe	hello.exe
  31474	   1228	134185024   134217726	7fffffe	minimum.exe
 559781	   5592	133652352   134217725	7fffffd	fileio.exe
 110380	   1768	134105580   134217728	8000000	nsecs.exe
 162196	   2056	134053476   134217728	8000000	paranoia.exe
  95682	   1684	134120360   134217726	7fffffe	ticker.exe
  94364	   1712	134121652   134217728	8000000	unlimited.exe
 860068	   1968	133355688   134217724	7fffffc	cxx_iostream.exe
 192553	   1720	134023448   134217721	7fffff9	cdtest.exe
 186476	   2184	134029068   134217728	8000000	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
  82762	   1652	134133312   134217726	7fffffe	base_sp.exe
  89960	   1604	134126164   134217728	8000000	hello.exe
  22368	   1194	134194164   134217726	7fffffe	minimum.exe
 541551	   5560	133670616   134217727	7ffffff	fileio.exe
 102222	   1740	134113764   134217726	7fffffe	nsecs.exe
 152484	   2028	134063216   134217728	8000000	paranoia.exe
  87182	   1656	134128888   134217726	7fffffe	ticker.exe
  84388	   1672	134131668   134217728	8000000	unlimited.exe
 509726	   1928	133706072   134217726	7fffffe	cxx_iostream.exe
 182133	   1696	134033896   134217725	7fffffd	cdtest.exe
 175060	   2124	134040544   134217728	8000000	capture.exe

For the m5484FireEngine BSP variant:

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
  92740	   1684	67014440    67108864	4000000	base_sp.exe
 101086	   1656	67006120    67108862	3fffffe	hello.exe
  32150	   1228	67075484    67108862	3fffffe	minimum.exe
 560459	   5592	66542812    67108863	3ffffff	fileio.exe
 111052	   1768	66996044    67108864	4000000	nsecs.exe
 162868	   2056	66943940    67108864	4000000	paranoia.exe
  96354	   1684	67010824    67108862	3fffffe	ticker.exe
  95036	   1712	67012116    67108864	4000000	unlimited.exe
 860740	   1968	66246152    67108860	3fffffc	cxx_iostream.exe
 193225	   1720	66913912    67108857	3fffff9	cdtest.exe
 187148	   2184	66919532    67108864	4000000	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
  83426	   1652	67023784    67108862	3fffffe	base_sp.exe
  90624	   1604	67016636    67108864	4000000	hello.exe
  23036	   1194	67084632    67108862	3fffffe	minimum.exe
 542221	   5560	66561080    67108861	3fffffd	fileio.exe
 102886	   1740	67004236    67108862	3fffffe	nsecs.exe
 153148	   2028	66953688    67108864	4000000	paranoia.exe
  87846	   1656	67019360    67108862	3fffffe	ticker.exe
  85052	   1672	67022140    67108864	4000000	unlimited.exe
 510390	   1928	66596544    67108862	3fffffe	cxx_iostream.exe
 182797	   1696	66924368    67108861	3fffffd	cdtest.exe
 175724	   2124	66931016    67108864	4000000	capture.exe

---

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

diff --git a/c/src/lib/libbsp/m68k/genmcf548x/make/custom/genmcf548x.inc b/c/src/lib/libbsp/m68k/genmcf548x/make/custom/genmcf548x.inc
index a910bd3..e93b185 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/make/custom/genmcf548x.inc
+++ b/c/src/lib/libbsp/m68k/genmcf548x/make/custom/genmcf548x.inc
@@ -13,6 +13,9 @@ CPU_CFLAGS = -mcfv4e -Wa,-memac
 
 # 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 binary --strip-all $(basename $@)$(EXEEXT) \




More information about the vc mailing list