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

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


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

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

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

The size of the sample executables without this option were:

   text    data     bss     dec     hex filename
  94272    1680    7664  103616   194c0 base_sp.exe
 108144    1648    7216  117008   1c910 hello.exe
  32528    1216    4912   38656    9700 minimum.exe
 113056    1760    7776  122592   1dee0 nsecs.exe
  98000    1680    7696  107376   1a370 ticker.exe
  95984    1712   11056  108752   1a8d0 unlimited.exe
 202224    2272    7840  212336   33d70 cdtest.exe

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

   text	   data	    bss	    dec	    hex	filename
  86224	   1648	   7616	  95488	  17500	base_sp.exe
  98512	   1600	   7152	 107264	  1a300	hello.exe
  24032	   1184	   4864	  30080	   7580	minimum.exe
 105520	   1728	   7712	 114960	  1c110	nsecs.exe
  90112	   1648	   7632	  99392	  18440	ticker.exe
  86576	   1664	  10992	  99232	  183a0	unlimited.exe
 185952	   2128	   7760	 195840	  2fd00	cdtest.exe

---

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

diff --git a/c/src/lib/libbsp/m68k/mcf52235/make/custom/mcf52235.cfg b/c/src/lib/libbsp/m68k/mcf52235/make/custom/mcf52235.cfg
index 9b22a21..b4431aa 100644
--- a/c/src/lib/libbsp/m68k/mcf52235/make/custom/mcf52235.cfg
+++ b/c/src/lib/libbsp/m68k/mcf52235/make/custom/mcf52235.cfg
@@ -13,6 +13,9 @@ CPU_CFLAGS = -mcpu=52235
 
 # optimize flag: typically -O2
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 # This defines the operations performed on the linked executable.
 # is currently required.



More information about the vc mailing list