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

Joel Sherrill joel at rtems.org
Sat Jan 23 18:51:11 UTC 2016


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

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

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

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 221793	  26856	  14537	 263186	  40412	base_sp.exe
 209281	  25692	  14497	 249470	  3ce7e	hello.exe
 202033	  25072	  11269	 238374	  3a326	minimum.exe
 638049	  94974	  26821	 759844	  b9824	fileio.exe
 243953	  28604	  14641	 287198	  461de	nsecs.exe
 254337	  39408	  15205	 308950	  4b6d6	paranoia.exe
 224961	  27024	  14569	 266554	  4113a	ticker.exe
 224257	  27792	  18313	 270362	  4201a	unlimited.exe
 973889	 215614	  22173	1211676	 127d1c	cxx_iostream.exe
 312369	  45540	  15209	 373118	  5b17e	cdtest.exe
 290177	  37456	  16361	 343994	  53fba	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
 189633	  22528	  14517	 226678	  37576	base_sp.exe
 175233	  21388	  14469	 211090	  33892	hello.exe
 147265	  19512	  10949	 177726	  2b63e	minimum.exe
 595393	  88650	  26509	 710552	  ad798	fileio.exe
 212561	  24252	  14621	 251434	  3d62a	nsecs.exe
 221953	  35032	  15181	 272166	  42726	paranoia.exe
 193089	  22696	  14549	 230334	  383be	ticker.exe
 190561	  23436	  18285	 232282	  38b5a	unlimited.exe
 624149	  52162	  21361	 697672	  aa548	cxx_iostream.exe
 280985	  32516	  15189	 328690	  503f2	cdtest.exe
 256993	  32928	  16341	 306262	  4ac56	capture.exe

---

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

diff --git a/c/src/lib/libbsp/powerpc/beatnik/make/custom/beatnik.cfg b/c/src/lib/libbsp/powerpc/beatnik/make/custom/beatnik.cfg
index a50657b..31c8ba6 100644
--- a/c/src/lib/libbsp/powerpc/beatnik/make/custom/beatnik.cfg
+++ b/c/src/lib/libbsp/powerpc/beatnik/make/custom/beatnik.cfg
@@ -23,6 +23,9 @@ CPU_CFLAGS = -mcpu=7400 -D__ppc_generic
 # NOTE: some level of -O may be actually required by inline assembler
 #CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions
 CFLAGS_OPTIMIZE_V = -O2 -g
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 # debug flags: typically none, but at least -O1 is required due to this
 # BSP using inlined code




More information about the vc mailing list