[rtems commit] m68k/mvme162: Add per-section compilation and linking support.

Joel Sherrill joel at rtems.org
Sat Jan 23 03:27:04 UTC 2016


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

Author:    Ralph Holmes <ralph at ybden.com>
Date:      Sat Jan 23 03:21:52 2016 +0000

m68k/mvme162: Add per-section compilation and linking support.

For the main BSP:

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
  85200	   1632	  11936	  98768	  181d0	base_sp.exe
 100224	   1600	  11536	 113360	  1bad0	hello.exe
  38432	   1216	   8016	  47664	   ba30	minimum.exe
 536336	   5552	  23424	 565312	  8a040	fileio.exe
 104192	   1728	  12048	 117968	  1ccd0	nsecs.exe
 185520	   2000	  12528	 200048	  30d70	paranoia.exe
  89424	   1632	  11968	 103024	  19270	ticker.exe
  87984	   1664	  15376	 105024	  19a40	unlimited.exe
 851456	  21440	  19008	 891904	  d9c00	cxx_iostream.exe
 191872	   2064	  12080	 206016	  324c0	cdtest.exe
 186288	   2144	  13760	 202192	  315d0	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
  77600	   1616	  11888	  91104	  163e0	base_sp.exe
  91824	   1568	  11472	 104864	  199a0	hello.exe
  29856	   1168	   7952	  38976	   9840	minimum.exe
 520432	   5520	  23088	 549040	  860b0	fileio.exe
  97616	   1712	  11984	 111312	  1b2d0	nsecs.exe
 177568	   1984	  12480	 192032	  2ee20	paranoia.exe
  82560	   1616	  11904	  96080	  17750	ticker.exe
  79760	   1632	  15312	  96704	  179c0	unlimited.exe
 168256	   2064	  11728	 182048	  2c720	cxx_iostream.exe
 176112	   2000	  12000	 190112	  2e6a0	cdtest.exe
 176656	   2096	  13712	 192464	  2efd0	capture.exe

For the mvme162lx BSP variant:

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
  85200	   1632	  11936	  98768	  181d0	base_sp.exe
 100224	   1600	  11536	 113360	  1bad0	hello.exe
  38432	   1216	   8016	  47664	   ba30	minimum.exe
 536336	   5552	  23424	 565312	  8a040	fileio.exe
 104192	   1728	  12048	 117968	  1ccd0	nsecs.exe
 185520	   2000	  12528	 200048	  30d70	paranoia.exe
  89424	   1632	  11968	 103024	  19270	ticker.exe
  87984	   1664	  15376	 105024	  19a40	unlimited.exe
 851456	  21440	  19008	 891904	  d9c00	cxx_iostream.exe
 191872	   2064	  12080	 206016	  324c0	cdtest.exe
 186288	   2144	  13760	 202192	  315d0	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
  77600	   1616	  11888	  91104	  163e0	base_sp.exe
  91824	   1568	  11472	 104864	  199a0	hello.exe
  29856	   1168	   7952	  38976	   9840	minimum.exe
 520432	   5520	  23088	 549040	  860b0	fileio.exe
  97616	   1712	  11984	 111312	  1b2d0	nsecs.exe
 177568	   1984	  12480	 192032	  2ee20	paranoia.exe
  82560	   1616	  11904	  96080	  17750	ticker.exe
  79760	   1632	  15312	  96704	  179c0	unlimited.exe
 168256	   2064	  11728	 182048	  2c720	cxx_iostream.exe
 176112	   2000	  12000	 190112	  2e6a0	cdtest.exe
 176656	   2096	  13712	 192464	  2efd0	capture.exe

---

 c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg   | 3 +++
 c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162lx.cfg | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg
index 4b343b2..40bc431 100644
--- a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg
+++ b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg
@@ -17,6 +17,9 @@ CPU_CFLAGS = -mcpu=68040 -msoft-float
 
 # optimize flag: typically -O2
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 define bsp-post-link
 	$(default-bsp-post-link)
diff --git a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162lx.cfg b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162lx.cfg
index 2a210a9..06bea9c 100644
--- a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162lx.cfg
+++ b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162lx.cfg
@@ -22,6 +22,9 @@ CPU_CFLAGS = -mcpu=68040 -msoft-float
 
 # optimize flag: typically -O2
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 define bsp-post-link
 	$(default-bsp-post-link)




More information about the vc mailing list