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

Joel Sherrill joel at rtems.org
Sat Jan 9 15:34:31 UTC 2016


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

Author:    Aun-Ali Zaidi <admin at kodeit.net>
Date:      Thu Jan  7 22:16:03 2016 -0600

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

The size of the sample executables without this option were:

   text	   data	  bss           dec             hex     filename
 107316	   1948	31315236	31424500	1df7ff4	minimum.exe
 124196	   2076	31298244	31424516	1df8004	base_sp.exe
 144584	   2164	31277760	31424508	1df7ffc	nsecs.exe
 193600	   2560	31228356	31424516	1df8004	capture.exe
 222500	   2104	31199904	31424508	1df7ffc	cdtest.exe
 189728	   2460	31232324	31424512	1df8000	paranoia.exe
 114336	   2028	31308132	31424496	1df7ff0	hello.exe
 565800	   5988	30852708	31424496	1df7ff0	fileio.exe
 127620	   2076	31294820	31424516	1df8004	ticker.exe
 274060	   6864	31143584	31424508	1df7ffc	loopback.exe
 612008	   2296	30810208	31424512	1df8000	cxx_iostream.exe
 452432	  12972	30959104	31424508	1df7ffc	pppd.exe
 127020	   2084	31295396	31424500	1df7ff4	unlimited.exe

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

   text	   data   bss		dec		hex	filename
  32008	   1436	31391076	31424520	1df8008	minimum.exe
 119172	   1924	31303396	31424492	1df7fec	base_sp.exe
 139648	   2012	31282848	31424508	1df7ffc	nsecs.exe
 185688	   2400	31236420	31424508	1df7ffc	capture.exe
 214612	   1952	31207936	31424500	1df7ff4	cdtest.exe
 184040	   2308	31238148	31424496	1df7ff0	paranoia.exe
 108352	   1868	31314276	31424496	1df7ff0	hello.exe
 549616	   5836	30869060	31424512	1df8000	fileio.exe
 122580	   1924	31300004	31424508	1df7ffc	ticker.exe
 254020	   6616	31163872	31424508	1df7ffc	loopback.exe
 435508	   2136	30986852	31424496	1df7ff0	cxx_iostream.exe
 419288	  12688	30992516	31424492	1df7fec	pppd.exe
 121396	   1924	31301188	31424508	1df7ffc	unlimited.exe

---

 c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg b/c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg
index 3693770..535b666 100644
--- a/c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg
+++ b/c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg
@@ -13,3 +13,7 @@ CPU_CFLAGS = -mcpu=arm920
 
 # optimize flag: typically -O2
 CFLAGS_OPTIMIZE_V = -O2 -g
+
+# Add CFLAGS and LDFLAGS for compiling and linking with per item sections
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+LDFLAGS            = -Wl,--gc-sections




More information about the vc mailing list