[rtems commit] sparc64/usiii: 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:    2533e797148575d32aff5a9656cbd16bd3dc5533
Changeset: http://git.rtems.org/rtems/commit/?id=2533e797148575d32aff5a9656cbd16bd3dc5533

Author:    Joel Sherrill <joel at rtems.org>
Date:      Thu Mar 10 17:43:44 2016 -0600

sparc64/usiii: Add per-section compilation and linking support

updates #2577.

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

   text	   data	    bss	    	  dec	    	  hex	filename
 180608	   2752	2113472	2296832	 230c00	ticker.exe
 114112	   1760	2105312	2221184	 21e480	minimum.exe
1041392	   3168	2126160	3170720	 3061a0	cxx_iostream.exe
 712224	   8912	2129200	2850336	 2b7e20	fileio.exe
 595248	  21568	2147872	2764688	 2a2f90	pppd.exe
 291488	   3912	2117440	2412840	 24d128	capture.exe
 200496	   2888	2113616	2317000	 235ac8	nsecs.exe
 279344	   3392	2114112	2396848	 2492b0	paranoia.exe
 324656	   2768	2115328	2442752	 254600	cdtest.exe
 178624	   2752	2113440	2294816	 230420	base_sp.exe
 179152	   2752	2117216	2299120	 2314f0	unlimited.exe
 190944	   2688	2113424	2307056	 2333f0	hello.exe
 381296	  10752	2126400	2518448	 266db0	loopback.exe

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

   text	   data	    bss	    	  dec	    	  hex	filename
 173312	   2632	2113184	2289128	 22ede8	ticker.exe
 102432	    328	2100928	2203688	 21a028	minimum.exe
 626544	   3032	2120400	2749976	 29f618	cxx_iostream.exe
 657584	   8792	2128640	2795016	 2aa608	fileio.exe
 555616	  21264	2146816	2723696	 298f70	pppd.exe
 280016	   3760	2117152	2400928	 24a2a0	capture.exe
 193792	   2768	2113312	2309872	 233ef0	nsecs.exe
 238528	   3264	2113808	2355600	 23f190	paranoia.exe
 277568	   2664	2115040	2395272	 248c88	cdtest.exe
 170592	   2624	2113152	2286368	 22e320	base_sp.exe
 169120	   2616	2112816	2284552	 22dc08	unlimited.exe
 180528	   2536	2109040	2292104	 22f988	hello.exe
 354992	  10528	2126016	2491536	 260490	loopback.exe

---

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

diff --git a/c/src/lib/libbsp/sparc64/usiii/make/custom/usiii.cfg b/c/src/lib/libbsp/sparc64/usiii/make/custom/usiii.cfg
index 66ab315..740e5b6 100644
--- a/c/src/lib/libbsp/sparc64/usiii/make/custom/usiii.cfg
+++ b/c/src/lib/libbsp/sparc64/usiii/make/custom/usiii.cfg
@@ -15,3 +15,6 @@ CPU_CFLAGS = -mcpu=ultrasparc3 -DUS3 -DSUN4U
 
 # optimize flag: typically -g -O2
 CFLAGS_OPTIMIZE_V = -g -O2
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections



More information about the vc mailing list