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

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


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

Author:    Joel Sherrill <joel at rtems.org>
Date:      Thu Mar 10 13:35:14 2016 -0600

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

updates #2577.

For the tms570ls3137_hdk BSP variant without this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  63760	   1708	 260224	 325692	  4f83c	ticker.exe
  40197	   1452	 260480	 302129	  49c31	minimum.exe
 557376	   1972	 260000	 819348	  c8094	cxx_iostream.exe
 400269	   5792	 256192	 662253	  a1aed	fileio.exe
 304684	  12608	 249632	 566924	  8a68c	pppd.exe
 132744	   2344	 259616	 394704	  605d0	capture.exe
  75578	   1796	 260160	 337534	  5267e	nsecs.exe
 113844	   2084	 259872	 375800	  5bbf8	paranoia.exe
 126688	   1732	 260224	 388644	  5ee24	cdtest.exe
  61480	   1708	 260224	 323412	  4ef54	base_sp.exe
  63220	   1716	 260224	 325160	  4f628	unlimited.exe
  68420	   1668	 260288	 330376	  50a88	hello.exe
 181144	   6492	 255744	 443380	  6c3f4	loopback.exe

For the tms570ls3137_hdk BSP variant with this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  59824	   1696	 260256	 321776	  4e8f0	ticker.exe
  24268	   1372	 260576	 286216	  45e08	minimum.exe
 346612	   1936	 260032	 608580	  94944	cxx_iostream.exe
 388973	   5780	 256192	 650945	  9eec1	fileio.exe
 283096	  12456	 249760	 545312	  85220	pppd.exe
 127016	   2324	 259648	 388988	  5ef7c	capture.exe
  71966	   1784	 260160	 333910	  51856	nsecs.exe
 109904	   2072	 259872	 371848	  5ac88	paranoia.exe
 120816	   1720	 260224	 382760	  5d728	cdtest.exe
  57416	   1696	 260256	 319368	  4df88	base_sp.exe
  58188	   1688	 260256	 320132	  4e284	unlimited.exe
  63064	   1616	 260320	 325000	  4f588	hello.exe
 167884	   6392	 255840	 430116	  69024	loopback.exe

For the tms570ls3137_hdk_intram BSP variant without this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  63760	   1708	 196384	 261852	  3fedc	ticker.exe
  40197	   1452	 220192	 261841	  3fed1	minimum.exe
 132744	   2344	 126752	 261840	  3fed0	capture.exe
  75578	   1796	 184484	 261858	  3fee2	nsecs.exe
 113844	   2084	 145920	 261848	  3fed8	paranoia.exe
 126688	   1732	 133440	 261860	  3fee4	cdtest.exe
  61480	   1708	 198656	 261844	  3fed4	base_sp.exe
  63220	   1716	 196900	 261836	  3fecc	unlimited.exe
  68420	   1668	 191744	 261832	  3fec8	hello.exe

For the tms570ls3137_hdk_intram BSP variant with this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  59824	   1696	 200320	 261840	  3fed0	ticker.exe
  24268	   1372	 236196	 261836	  3fecc	minimum.exe
 127016	   2324	 132512	 261852	  3fedc	capture.exe
  71966	   1784	 188096	 261846	  3fed6	nsecs.exe
 109904	   2072	 149856	 261832	  3fec8	paranoia.exe
 120816	   1720	 139296	 261832	  3fec8	cdtest.exe
  57416	   1696	 202720	 261832	  3fec8	base_sp.exe
  58188	   1688	 201956	 261832	  3fec8	unlimited.exe
  63064	   1616	 197152	 261832	  3fec8	hello.exe

For the tms570ls3137_hdk_sdram BSP variant without this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  63760	   1708	8323104	8388572	 7fffdc	ticker.exe
  40197	   1452	8346912	8388561	 7fffd1	minimum.exe
 557376	   1972	7829220	8388568	 7fffd8	cxx_iostream.exe
 400275	   5792	7982500	8388567	 7fffd7	fileio.exe
 304684	  12608	8071264	8388556	 7fffcc	pppd.exe
 132744	   2344	8253472	8388560	 7fffd0	capture.exe
  75578	   1796	8311204	8388578	 7fffe2	nsecs.exe
 113844	   2084	8272640	8388568	 7fffd8	paranoia.exe
 126688	   1732	8260160	8388580	 7fffe4	cdtest.exe
  61480	   1708	8325376	8388564	 7fffd4	base_sp.exe
  63220	   1716	8323620	8388556	 7fffcc	unlimited.exe
  68420	   1668	8318464	8388552	 7fffc8	hello.exe
 181144	   6492	8200928	8388564	 7fffd4	loopback.exe

For the tms570ls3137_hdk_sdram BSP variant with this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  59824	   1696	8327040	8388560	 7fffd0	ticker.exe
  24268	   1372	8362916	8388556	 7fffcc	minimum.exe
 346612	   1936	8040004	8388552	 7fffc8	cxx_iostream.exe
 388979	   5780	7993796	8388555	 7fffcb	fileio.exe
 283096	  12456	8092996	8388548	 7fffc4	pppd.exe
 127016	   2324	8259232	8388572	 7fffdc	capture.exe
  71966	   1784	8314816	8388566	 7fffd6	nsecs.exe
 109904	   2072	8276576	8388552	 7fffc8	paranoia.exe
 120816	   1720	8266016	8388552	 7fffc8	cdtest.exe
  57416	   1696	8329440	8388552	 7fffc8	base_sp.exe
  58188	   1688	8328676	8388552	 7fffc8	unlimited.exe
  63064	   1616	8323872	8388552	 7fffc8	hello.exe
 167884	   6392	8214272	8388548	 7fffc4	loopback.exe

For the tms570ls3137_hdk_with_loader BSP variant without this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  63760	   1708	 260224	 325692	  4f83c	ticker.exe
  40197	   1452	 260480	 302129	  49c31	minimum.exe
 557376	   1972	 260000	 819348	  c8094	cxx_iostream.exe
 400281	   5792	 256192	 662265	  a1af9	fileio.exe
 304684	  12608	 249632	 566924	  8a68c	pppd.exe
 132744	   2344	 259616	 394704	  605d0	capture.exe
  75578	   1796	 260160	 337534	  5267e	nsecs.exe
 113844	   2084	 259872	 375800	  5bbf8	paranoia.exe
 126688	   1732	 260224	 388644	  5ee24	cdtest.exe
  61480	   1708	 260224	 323412	  4ef54	base_sp.exe
  63220	   1716	 260224	 325160	  4f628	unlimited.exe
  68420	   1668	 260288	 330376	  50a88	hello.exe
 181144	   6492	 255744	 443380	  6c3f4	loopback.exe

For the tms570ls3137_hdk_with_loader BSP variant with this option,
sample executables sizes were as follows:

   text	   data	    bss	    	  dec	    	  hex	filename
  59824	   1696	 260256	 321776	  4e8f0	ticker.exe
  24268	   1372	 260576	 286216	  45e08	minimum.exe
 346612	   1936	 260032	 608580	  94944	cxx_iostream.exe
 388985	   5780	 256192	 650957	  9eecd	fileio.exe
 283096	  12456	 249760	 545312	  85220	pppd.exe
 127016	   2324	 259648	 388988	  5ef7c	capture.exe
  71966	   1784	 260160	 333910	  51856	nsecs.exe
 109904	   2072	 259872	 371848	  5ac88	paranoia.exe
 120816	   1720	 260224	 382760	  5d728	cdtest.exe
  57416	   1696	 260256	 319368	  4df88	base_sp.exe
  58188	   1688	 260256	 320132	  4e284	unlimited.exe
  63064	   1616	 260320	 325000	  4f588	hello.exe
 167884	   6392	 255840	 430116	  69024	loopback.exe

---

 c/src/lib/libbsp/arm/tms570/make/custom/tms570ls3137.inc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/c/src/lib/libbsp/arm/tms570/make/custom/tms570ls3137.inc b/c/src/lib/libbsp/arm/tms570/make/custom/tms570ls3137.inc
index 869cf71..76d5ccd 100644
--- a/c/src/lib/libbsp/arm/tms570/make/custom/tms570ls3137.inc
+++ b/c/src/lib/libbsp/arm/tms570/make/custom/tms570ls3137.inc
@@ -6,9 +6,14 @@ include $(RTEMS_ROOT)/make/custom/default.cfg
 
 RTEMS_CPU = arm
 
-CPU_CFLAGS = -march=armv7-r -mthumb -mbig-endian -mfpu=vfpv3-d16 -mfloat-abi=hard
+CPU_CFLAGS  = -march=armv7-r -mthumb -mbig-endian
+CPU_CFLAGS += -mfpu=vfpv3-d16 -mfloat-abi=hard
 
 CFLAGS_OPTIMIZE_V = -O2 -ggdb
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
+
 BINEXT?=.bin
 
 # This defines the operations performed on the linked executable.




More information about the vc mailing list