[rtems commit] arm/smdk2410: Add per-section compilation and linking support

Joel Sherrill joel at rtems.org
Fri Mar 11 20:14:54 UTC 2016


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

Author:    Joel Sherrill <joel at rtems.org>
Date:      Thu Mar 10 13:25:13 2016 -0600

arm/smdk2410: Add per-section compilation and linking support

updates #2577.

For the smdk2410 BSP variant without this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  97924	   1980	66992576	67092480	3ffc000	ticker.exe
  38256	   1400	67052800	67092456	3ffbfe8	minimum.exe
 820960	   2268	66269220	67092448	3ffbfe0	cxx_iostream.exe
 576981	   6056	66509440	67092477	3ffbffd	fileio.exe
 455008	  12872	66624576	67092456	3ffbfe8	pppd.exe
 198696	   2616	66891136	67092448	3ffbfe0	capture.exe
 116096	   2068	66974308	67092472	3ffbff8	nsecs.exe
 181880	   2364	66908224	67092468	3ffbff4	paranoia.exe
 191224	   2012	66899232	67092468	3ffbff4	cdtest.exe
  94916	   1980	66995584	67092480	3ffc000	base_sp.exe
  98184	   2012	66992260	67092456	3ffbfe8	unlimited.exe
 107860	   1956	66982656	67092472	3ffbff8	hello.exe
 278248	   6764	66807456	67092468	3ffbff4	loopback.exe

For the smdk2410 BSP variant with this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  91532	   1820	66999104	67092456	3ffbfe8	ticker.exe
  25508	    380	67066564	67092452	3ffbfe4	minimum.exe
 512240	   2068	66578148	67092456	3ffbfe8	cxx_iostream.exe
 559481	   5904	66527072	67092457	3ffbfe9	fileio.exe
 419052	  12580	66660836	67092468	3ffbff4	pppd.exe
 188604	   2440	66901408	67092452	3ffbfe4	capture.exe
 110260	   1908	66980288	67092456	3ffbfe8	nsecs.exe
 173608	   2188	66916672	67092468	3ffbff4	paranoia.exe
 182184	   1852	66908416	67092452	3ffbfe4	cdtest.exe
  87660	   1812	67003008	67092480	3ffc000	base_sp.exe
  88336	   1812	67002308	67092456	3ffbfe8	unlimited.exe
  97604	   1740	66993120	67092464	3ffbff0	hello.exe
 255352	   6516	66830592	67092460	3ffbfec	loopback.exe

---

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

diff --git a/c/src/lib/libbsp/arm/smdk2410/make/custom/smdk2410.cfg b/c/src/lib/libbsp/arm/smdk2410/make/custom/smdk2410.cfg
index 874c5ad..c2b9273 100644
--- a/c/src/lib/libbsp/arm/smdk2410/make/custom/smdk2410.cfg
+++ b/c/src/lib/libbsp/arm/smdk2410/make/custom/smdk2410.cfg
@@ -13,3 +13,6 @@ CPU_CFLAGS = -mcpu=arm920t -DCPU_S3C2410
 
 # optimize flag: typically -O2
 CFLAGS_OPTIMIZE_V = -O2 -g
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections



More information about the vc mailing list