[rtems commit] arm/lpc24xx (lpc40xx variants) Add per-section compilation and linking suppo

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


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

Author:    Joel Sherrill <joel at rtems.org>
Date:      Thu Mar 10 11:39:54 2016 -0600

arm/lpc24xx (lpc40xx variants) Add per-section compilation and linking suppo

updates #2577.

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

   text	   data	    bss	    	  dec	    	  hex	filename
  63894	   1724	33554336	33619954	200fff2	ticker.exe
  21802	   1088	33597056	33619946	200ffea	minimum.exe
 549842	   2004	33068096	33619942	200ffe6	cxx_iostream.exe
 391958	   5800	33222176	33619934	200ffde	fileio.exe
 299670	  12616	33307680	33619966	200fffe	pppd.exe
 134162	   2360	33483424	33619946	200ffea	capture.exe
  75204	   1812	33542944	33619960	200fff8	nsecs.exe
 125934	   2100	33491904	33619938	200ffe2	paranoia.exe
 128182	   1748	33490016	33619946	200ffea	cdtest.exe
  61902	   1724	33556320	33619946	200ffea	base_sp.exe
  63566	   1748	33554624	33619938	200ffe2	unlimited.exe
  71702	   1692	33546560	33619954	200fff2	hello.exe
 180790	   6500	33432672	33619962	200fffa	loopback.exe

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

   text	   data	    bss	    	  dec	    	  hex	filename
  59154	   1712	33559072	33619938	200ffe2	ticker.exe
  13958	    280	33605728	33619966	200fffe	minimum.exe
 336422	   1960	33281568	33619950	200ffee	cxx_iostream.exe
 380222	   5788	33233920	33619930	200ffda	fileio.exe
 277050	  12464	33330432	33619946	200ffea	pppd.exe
 127586	   2340	33490016	33619942	200ffe6	capture.exe
  70780	   1800	33547360	33619940	200ffe4	nsecs.exe
 121126	   2088	33496736	33619950	200ffee	paranoia.exe
 121466	   1736	33496736	33619938	200ffe2	cdtest.exe
  57034	   1712	33561216	33619962	200fffa	base_sp.exe
  57494	   1712	33560736	33619942	200ffe6	unlimited.exe
  65326	   1640	33552992	33619958	200fff6	hello.exe
 166862	   6400	33446688	33619950	200ffee	loopback.exe

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

   text	   data	    bss	    	  dec	    	  hex	filename
  64062	   1724	33557096	33622882	2010b62	ticker.exe
  21970	   1088	33557704	33580762	20066da	minimum.exe
 392130	   5800	33553064	33950994	2060d12	fileio.exe
 299838	  12616	33546504	33858958	204a58e	pppd.exe
 134330	   2360	33556488	33693178	2021dfa	capture.exe
  75372	   1812	33557000	33634184	2013788	nsecs.exe
 126102	   2100	33556712	33684914	201fdb2	paranoia.exe
 128350	   1748	33557096	33687194	202069a	cdtest.exe
  62070	   1724	33557096	33620890	201039a	base_sp.exe
  63734	   1748	33557064	33622546	2010a12	unlimited.exe
  71870	   1692	33557128	33630690	20129e2	hello.exe
 180958	   6500	33552616	33740074	202d52a	loopback.exe

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

   text	   data	    bss	    	  dec	    	  hex	filename
  59322	   1712	33557096	33618130	200f8d2	ticker.exe
  14126	    280	33558504	33572910	200482e	minimum.exe
 336590	   1960	33556904	33895454	205341e	cxx_iostream.exe
 380394	   5788	33553064	33939246	205df2e	fileio.exe
 277218	  12464	33546632	33836314	2044d1a	pppd.exe
 127754	   2340	33556488	33686582	2020436	capture.exe
  70948	   1800	33557000	33629748	2012634	nsecs.exe
 121294	   2088	33556712	33680094	201eade	paranoia.exe
 121634	   1736	33557096	33680466	201ec52	cdtest.exe
  57202	   1712	33557096	33616010	200f08a	base_sp.exe
  57662	   1712	33557096	33616470	200f256	unlimited.exe
  65494	   1640	33557160	33624294	20110e6	hello.exe
 167030	   6400	33552712	33726142	2029ebe	loopback.exe

---

 c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc40xx.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc40xx.inc b/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc40xx.inc
index 2c921db..5460a95 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc40xx.inc
+++ b/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc40xx.inc
@@ -9,3 +9,6 @@ RTEMS_CPU = arm
 CPU_CFLAGS = -mthumb -march=armv7-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mtune=cortex-m4
 
 CFLAGS_OPTIMIZE_V = -O2 -g
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections



More information about the vc mailing list