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

Joel Sherrill joel at rtems.org
Sat Jan 9 20:10:24 UTC 2016


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

Author:    Aun-Ali Zaidi <admin at kodeit.net>
Date:      Sat Jan  9 13:34:44 2016 -0600

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

The size of the sample executables without this option were:

   text	   data	  bss		dec		hex	filename
  58932	   1700	67031844	67092476	3ffbffc	minimum.exe
  91364	   1956	66999140	67092460	3ffbfec	base_sp.exe
 111756	   2044	66978660	67092460	3ffbfec	nsecs.exe
 189636	   2440	66900388	67092464	3ffbff0	capture.exe
 203520	   1984	66886976	67092480	3ffc000	cdtest.exe
 178068	   2340	66912068	67092476	3ffbffc	paranoia.exe
 104468	   1908	66986084	67092460	3ffbfec	hello.exe
 553352	   5892	66533220	67092464	3ffbff0	fileio.exe
  94780	   1956	66995716	67092452	3ffbfe4	ticker.exe
 269384	   6752	66816320	67092456	3ffbfe8	loopback.exe
 590408	   2176	66499872	67092456	3ffbfe8	cxx_iostream.exe
 447928	  12860	66631684	67092472	3ffbff8	pppd.exe
  93476	   1964	66997028	67092468	3ffbff4	unlimited.exe

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

   text	   data	  bss		dec		hex	filename
  31352	   1276	67059840	67092468	3ffbff4	minimum.exe
  85492	   1804	67005156	67092452	3ffbfe4	base_sp.exe
 105964	   1892	66984612	67092468	3ffbff4	nsecs.exe
 181748	   2280	66908420	67092448	3ffbfe0	capture.exe
 195592	   1832	66895040	67092464	3ffbff0	cdtest.exe
 172044	   2180	66918244	67092468	3ffbff4	paranoia.exe
  96396	   1748	66994308	67092452	3ffbfe4	hello.exe
 537240	   5740	66549476	67092456	3ffbfe8	fileio.exe
  88884	   1804	67001764	67092452	3ffbfe4	ticker.exe
 249568	   6504	66836384	67092456	3ffbfe8	loopback.exe
 412652	   2016	66677796	67092464	3ffbff0	cxx_iostream.exe
 415208	  12584	66664672	67092464	3ffbff0	pppd.exe
  85728	   1804	67004932	67092464	3ffbff0	unlimited.exe

---

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

diff --git a/c/src/lib/libbsp/arm/gumstix/make/custom/gumstix.cfg b/c/src/lib/libbsp/arm/gumstix/make/custom/gumstix.cfg
index fafcbd5..a8d9fd3 100644
--- a/c/src/lib/libbsp/arm/gumstix/make/custom/gumstix.cfg
+++ b/c/src/lib/libbsp/arm/gumstix/make/custom/gumstix.cfg
@@ -13,3 +13,7 @@ CPU_CFLAGS = -mcpu=xscale
 
 # 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