[PATCH 07/32] arm/realview_pbx_a9_qemu: Add per-section compilation and linking support

Joel Sherrill joel at rtems.org
Fri Mar 11 00:15:11 UTC 2016


updates #2577.

NOTE: In contrast to other BSPs, this was built with SMP enabled to
      ensure the _smp variant was built properly.

For the realview_pbx_a9_qemu BSP variant without this option,
sample executable sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
 129776	   1692	267238996	267370464	fefbfe0	ticker.exe
  92729	   1452	267276272	267370453	fefbfd5	minimum.exe
 624404	   1980	266744076	267370460	fefbfdc	cxx_iostream.exe
 597787	   5936	266766716	267370439	fefbfc7	fileio.exe
 470724	  14336	266885392	267370452	fefbfd4	pppd.exe
 219648	   2448	267148360	267370456	fefbfd8	capture.exe
 140398	   1780	267228276	267370454	fefbfd6	nsecs.exe
 200972	   2100	267167384	267370456	fefbfd8	paranoia.exe
 193188	   1716	267175568	267370472	fefbfe8	cdtest.exe
 125512	   1692	267243260	267370464	fefbfe0	base_sp.exe
 129392	   1724	267239348	267370464	fefbfe0	unlimited.exe
 126564	   1668	267242240	267370472	fefbfe8	hello.exe
 289336	   6708	267074400	267370444	fefbfcc	loopback.exe

For the realview_pbx_a9_qemu BSP variant with this option,
sample executable sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
 122812	   1684	267245960	267370456	fefbfd8	ticker.exe
  61366	   1368	267307732	267370466	fefbfe2	minimum.exe
 409100	   1948	266959408	267370456	fefbfd8	cxx_iostream.exe
 579093	   5928	266785444	267370465	fefbfe1	fileio.exe
 435584	  14084	266920804	267370472	fefbfe8	pppd.exe
 207412	   2432	267160600	267370444	fefbfcc	capture.exe
 134006	   1772	267234668	267370446	fefbfce	nsecs.exe
 193744	   2092	267174608	267370444	fefbfcc	paranoia.exe
 184796	   1716	267183960	267370472	fefbfe8	cdtest.exe
 118288	   1684	267250484	267370456	fefbfd8	base_sp.exe
 118636	   1700	267250136	267370472	fefbfe8	unlimited.exe
 115488	   1628	267253344	267370460	fefbfdc	hello.exe
 268276	   6508	267095664	267370448	fefbfd0	loopback.exe

For the realview_pbx_a9_qemu_smp BSP variant without this option,
sample executable sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
 129776	   1692	267238996	267370464	fefbfe0	ticker.exe
  92729	   1452	267276272	267370453	fefbfd5	minimum.exe
 624404	   1980	266744076	267370460	fefbfdc	cxx_iostream.exe
 597791	   5936	266766712	267370439	fefbfc7	fileio.exe
 470724	  14336	266885392	267370452	fefbfd4	pppd.exe
 219648	   2448	267148360	267370456	fefbfd8	capture.exe
 140398	   1780	267228276	267370454	fefbfd6	nsecs.exe
 200972	   2100	267167384	267370456	fefbfd8	paranoia.exe
 193188	   1716	267175568	267370472	fefbfe8	cdtest.exe
 125512	   1692	267243260	267370464	fefbfe0	base_sp.exe
 129392	   1724	267239348	267370464	fefbfe0	unlimited.exe
 126564	   1668	267242240	267370472	fefbfe8	hello.exe
 289336	   6708	267074400	267370444	fefbfcc	loopback.exe

For the realview_pbx_a9_qemu_smp BSP variant with this option,
sample executable sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
 122812	   1684	267245960	267370456	fefbfd8	ticker.exe
  61366	   1368	267307732	267370466	fefbfe2	minimum.exe
 409100	   1948	266959408	267370456	fefbfd8	cxx_iostream.exe
 579097	   5928	266785440	267370465	fefbfe1	fileio.exe
 435584	  14084	266920804	267370472	fefbfe8	pppd.exe
 207412	   2432	267160600	267370444	fefbfcc	capture.exe
 134006	   1772	267234668	267370446	fefbfce	nsecs.exe
 193744	   2092	267174608	267370444	fefbfcc	paranoia.exe
 184796	   1716	267183960	267370472	fefbfe8	cdtest.exe
 118288	   1684	267250484	267370456	fefbfd8	base_sp.exe
 118636	   1700	267250136	267370472	fefbfe8	unlimited.exe
 115488	   1628	267253344	267370460	fefbfdc	hello.exe
 268276	   6508	267095664	267370448	fefbfd0	loopback.exe
---
 .../libbsp/arm/realview-pbx-a9/make/custom/realview_pbx_a9_qemu.cfg    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/make/custom/realview_pbx_a9_qemu.cfg b/c/src/lib/libbsp/arm/realview-pbx-a9/make/custom/realview_pbx_a9_qemu.cfg
index 5b63eed..19531d3 100644
--- a/c/src/lib/libbsp/arm/realview-pbx-a9/make/custom/realview_pbx_a9_qemu.cfg
+++ b/c/src/lib/libbsp/arm/realview-pbx-a9/make/custom/realview_pbx_a9_qemu.cfg
@@ -3,5 +3,8 @@ include $(RTEMS_ROOT)/make/custom/default.cfg
 RTEMS_CPU = arm
 
 CPU_CFLAGS = -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 CFLAGS_OPTIMIZE_V ?= -O0 -g
-- 
1.8.3.1




More information about the devel mailing list