[rtems commit] arm/lpc176x: Add per-section compilation and linking support

Joel Sherrill joel at rtems.org
Sat Jan 16 17:18:14 UTC 2016


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

Author:    Aun-Ali Zaidi <admin at kodeit.net>
Date:      Fri Jan 15 23:45:29 2016 -0600

arm/lpc176x: Add per-section compilation and linking support

ARM mbed LPC1768:
=================

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
  92032	   1812	  30984	 124828	  1e79c	unlimited.exe
 389316	   5692	  27112	 422120	  670e8	fileio.exe
  92696	   1780	  31016	 125492	  1ea34	ticker.exe
 100144	   1868	  30920	 132932	  20744	nsecs.exe
 146696	   1800	  31016	 179512	  2bd38	cdtest.exe
 131480	   2256	  30536	 164272	  281b0	capture.exe
  83568	   1756	  31048	 116372	  1c694	hello.exe
 137628	   2164	  30632	 170424	  299b8	paranoia.exe
 178624	   6560	  26536	 211720	  33b08	loopback.exe
  90432	   1780	  31016	 123228	  1e15c	base_sp.exe
  67048	   1536	  31272	  99856	  18610	minimum.exe

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

   text	   data	    bss	    dec	    hex	filename
  75004	   1784	  31016	 107804	  1a51c	unlimited.exe
 377172	   5680	  27112	 409964	  6416c	fileio.exe
  48152	   1320	  31464	  80936	  13c28	minimum.exe
  66276	   1712	  31080	  99068	  182fc	hello.exe
  74548	   1768	  31016	 107332	  1a344	base_sp.exe
  76916	   1768	  31016	 109700	  1ac84	ticker.exe
 124620	   2236	  30568	 157424	  266f0	capture.exe
 165108	   6460	  26632	 198200	  30638	loopback.exe
 121864	   2152	  30632	 154648	  25c18	paranoia.exe
 139056	   1796	  31016	 171868	  29f5c	cdtest.exe
  87732	   1856	  30952	 120540	  1d6dc	nsecs.exe

ARM mbed LPC1768 AHB SRAM:
==========================

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
  92032	   1812	  63752	 157596	  2679c	unlimited.exe
 146696	   1800	  63784	 212280	  33d38	cdtest.exe
  92696	   1780	  63784	 158260	  26a34	ticker.exe
  83568	   1756	  63816	 149140	  24694	hello.exe
 178624	   6560	  59304	 244488	  3bb08	loopback.exe
 137628	   2164	  63400	 203192	  319b8	paranoia.exe
 389324	   5692	  59880	 454896	  6f0f0	fileio.exe
  90432	   1780	  63784	 155996	  2615c	base_sp.exe
  67048	   1536	  64040	 132624	  20610	minimum.exe
 131480	   2256	  63304	 197040	  301b0	capture.exe
 100144	   1868	  63688	 165700	  28744	nsecs.exe

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

   text	   data	    bss	    dec	    hex	filename
 377180	   5680	  59880	 442740	  6c174	fileio.exe
 165108	   6460	  59400	 230968	  38638	loopback.exe
 121864	   2152	  63400	 187416	  2dc18	paranoia.exe
  76916	   1768	  63784	 142468	  22c84	ticker.exe
 139056	   1796	  63784	 204636	  31f5c	cdtest.exe
  87732	   1856	  63720	 153308	  256dc	nsecs.exe
 124620	   2236	  63336	 190192	  2e6f0	capture.exe
  75004	   1784	  63784	 140572	  2251c	unlimited.exe
  66276	   1712	  63848	 131836	  202fc	hello.exe
  74548	   1768	  63784	 140100	  22344	base_sp.exe
  48152	   1320	  64232	 113704	  1bc28	minimum.exe

ARM mbed LPC1768 AHB SRAM w/ Ethernet:
======================================

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
  90432	   1780	  38580	 130792	  1fee8	base_sp.exe
  67048	   1536	  34892	 103476	  19434	minimum.exe
  92696	   1780	  38636	 133112	  207f8	ticker.exe
 131480	   2256	  39932	 173668	  2a664	capture.exe
  83568	   1756	  38156	 123480	  1e258	hello.exe
 100144	   1868	  38588	 140600	  22538	nsecs.exe
 178624	   6560	  41224	 226408	  37468	loopback.exe
 137628	   2164	  38868	 178660	  2b9e4	paranoia.exe
  92032	   1812	  41940	 135784	  21268	unlimited.exe

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

   text	   data	    bss	    dec	    hex	filename
  75004	   1784	  41896	 118684	  1cf9c	unlimited.exe
  87732	   1856	  38536	 128124	  1f47c	nsecs.exe
  76916	   1768	  38584	 117268	  1ca14	ticker.exe
  66276	   1712	  38128	 106116	  19e84	hello.exe
 124620	   2236	  39888	 166744	  28b58	capture.exe
 165108	   6460	  41188	 212756	  33f14	loopback.exe
 121864	   2152	  38816	 162832	  27c10	paranoia.exe
  48152	   1320	  35064	  84536	  14a38	minimum.exe
  74548	   1768	  38560	 114876	  1c0bc	base_sp.exe

---

 c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed.cfg | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed.cfg b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed.cfg
index a5ed9c6..6e7b32c 100644
--- a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed.cfg
+++ b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed.cfg
@@ -9,6 +9,11 @@ RTEMS_CPU = arm
 CPU_CFLAGS = -march=armv7-m -mthumb
 
 CFLAGS_OPTIMIZE_V = -O2 -ggdb3
+
+# Add CFLAGS and LDFLAGS for compiling and linking with per item sections
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+LDFLAGS            = -Wl,--gc-sections
+
 BINEXT?=.bin
 # This defines the operations performed on the linked executable.
 # is currently required.




More information about the vc mailing list