[rtems commit] powerpc/virtex: Add per-section compilation and linking support.

Joel Sherrill joel at rtems.org
Sat Jan 23 19:57:51 UTC 2016


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

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

powerpc/virtex: Add per-section compilation and linking support.

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 136928	   2284	134078500	134217712	7fffff0	base_sp.exe
 152124	   2168	134063412	134217704	7ffffe8	hello.exe
  96317	   1892	134119500	134217709	7ffffed	minimum.exe
 658001	   6274	133553428	134217703	7ffffe7	fileio.exe
 161562	   2380	134053772	134217714	7fffff2	nsecs.exe
 229008	   2668	133986040	134217716	7fffff4	paranoia.exe
 140224	   2292	134075204	134217720	7fffff8	ticker.exe
 139564	   2308	134075836	134217708	7ffffec	unlimited.exe
 951004	 147150	133119544	134217698	7ffffe2	cxx_iostream.exe
 256264	   9352	133952104	134217720	7fffff8	cdtest.exe
 254760	   2788	133960156	134217704	7ffffe8	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
 123180	   2268	134092272	134217720	7fffff8	base_sp.exe
 136152	   2112	134079448	134217712	7fffff0	hello.exe
  53640	   1560	134162508	134217708	7ffffec	minimum.exe
 632433	   6238	133579016	134217687	7ffffd7	fileio.exe
 148538	   2364	134066808	134217710	7ffffee	nsecs.exe
 214540	   2644	134000536	134217720	7fffff8	paranoia.exe
 126732	   2276	134088688	134217696	7ffffe0	ticker.exe
 124292	   2268	134091136	134217696	7ffffe0	unlimited.exe
 608992	  50546	133558180	134217718	7fffff6	cxx_iostream.exe
 243452	   8036	133966228	134217716	7fffff4	cdtest.exe
 238360	   2740	133976616	134217716	7fffff4	capture.exe

---

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

diff --git a/c/src/lib/libbsp/powerpc/virtex/make/custom/virtex.cfg b/c/src/lib/libbsp/powerpc/virtex/make/custom/virtex.cfg
index 8af4072..05110a2 100644
--- a/c/src/lib/libbsp/powerpc/virtex/make/custom/virtex.cfg
+++ b/c/src/lib/libbsp/powerpc/virtex/make/custom/virtex.cfg
@@ -16,6 +16,9 @@ CPU_CFLAGS = -mcpu=403 -Dppc405 -meabi -msdata=sysv -fno-common
 # -O4 is ok for RTEMS
 # NOTE: some level of -O may be actually required by inline assembler
 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 define bsp-post-link
 	$(default-bsp-post-link)



More information about the vc mailing list