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

Joel Sherrill joel at rtems.org
Sat Jan 23 03:20:46 UTC 2016


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

Author:    Ralph Holmes <ralph at ybden.com>
Date:      Sat Jan 23 02:59:32 2016 +0000

m68k/gen68360: 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
 117616	   1728	  27312	 146656	  23ce0	base_sp.exe
 108256	   1696	  26912	 136864	  216a0	hello.exe
  29728	   1216	  23344	  54288	   d410	minimum.exe
 535168	   5632	  38800	 579600	  8d810	fileio.exe
 136624	   1808	  27424	 165856	  287e0	nsecs.exe
 192128	   2112	  27920	 222160	  363d0	paranoia.exe
 121472	   1728	  27344	 150544	  24c10	ticker.exe
 120304	   1760	  30752	 152816	  254f0	unlimited.exe
 859008	  21600	  34400	 915008	  df640	cxx_iostream.exe
 207536	   2320	  27488	 237344	  39f20	cdtest.exe
 185136	   2224	  29136	 216496	  34db0	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
 110384	   1696	  27248	 139328	  22040	base_sp.exe
 100080	   1648	  26832	 128560	  1f630	hello.exe
  22496	   1184	  23296	  46976	   b780	minimum.exe
 519376	   5600	  38464	 563440	  898f0	fileio.exe
 130432	   1776	  27360	 159568	  26f50	nsecs.exe
 184448	   2064	  27856	 214368	  34560	paranoia.exe
 114976	   1696	  27280	 143952	  23250	ticker.exe
 112448	   1712	  30672	 144832	  235c0	unlimited.exe
 190368	   2256	  27136	 219760	  35a70	cxx_iostream.exe
 191312	   2176	  27408	 220896	  35ee0	cdtest.exe
 175216	   2160	  29072	 206448	  32670	capture.exe

For the gen68360_040 BSP variant:

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 112624	   1712	  27328	 141664	  22960	base_sp.exe
 101584	   1680	  26912	 130176	  1fc80	hello.exe
  29936	   1184	  23344	  54464	   d4c0	minimum.exe
 530080	   5616	  38800	 574496	  8c420	fileio.exe
 131552	   1792	  27424	 160768	  27400	nsecs.exe
 161296	   2080	  27920	 191296	  2eb40	paranoia.exe
 116400	   1712	  27344	 145456	  23830	ticker.exe
 115312	   1728	  30752	 147792	  24150	unlimited.exe
 861952	  21488	  34384	 917824	  e0140	cxx_iostream.exe
 202336	   2128	  27472	 231936	  38a00	cdtest.exe
 179968	   2208	  29136	 211312	  33970	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
 105360	   1664	  27264	 134288	  20c90	base_sp.exe
  93360	   1616	  26832	 121808	  1dbd0	hello.exe
  21840	   1152	  23296	  46288	   b4d0	minimum.exe
 513920	   5568	  38464	 557952	  88380	fileio.exe
 125312	   1760	  27360	 154432	  25b40	nsecs.exe
 153632	   2048	  27856	 183536	  2ccf0	paranoia.exe
 109856	   1680	  27280	 138816	  21e40	ticker.exe
 107376	   1680	  30672	 139728	  221d0	unlimited.exe
 185040	   2128	  27104	 214272	  34500	cxx_iostream.exe
 186032	   2064	  27376	 215472	  349b0	cdtest.exe
 170016	   2144	  29072	 201232	  31210	capture.exe

For the pgh360 BSP variant:

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 117424	   1728	  27312	 146464	  23c20	base_sp.exe
 108064	   1696	  26912	 136672	  215e0	hello.exe
  29536	   1216	  23344	  54096	   d350	minimum.exe
 534976	   5632	  38800	 579408	  8d750	fileio.exe
 136432	   1808	  27424	 165664	  28720	nsecs.exe
 191936	   2112	  27920	 221968	  36310	paranoia.exe
 121280	   1728	  27344	 150352	  24b50	ticker.exe
 120096	   1760	  30752	 152608	  25420	unlimited.exe
 858816	  21600	  34400	 914816	  df580	cxx_iostream.exe
 207344	   2320	  27488	 237152	  39e60	cdtest.exe
 184944	   2224	  29136	 216304	  34cf0	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
 110176	   1696	  27248	 139120	  21f70	base_sp.exe
  99888	   1648	  26832	 128368	  1f570	hello.exe
  22304	   1184	  23296	  46784	   b6c0	minimum.exe
 519168	   5600	  38464	 563232	  89820	fileio.exe
 130224	   1776	  27360	 159360	  26e80	nsecs.exe
 184256	   2064	  27856	 214176	  344a0	paranoia.exe
 114784	   1696	  27280	 143760	  23190	ticker.exe
 112256	   1712	  30672	 144640	  23500	unlimited.exe
 190160	   2256	  27136	 219552	  359a0	cxx_iostream.exe
 191120	   2176	  27408	 220704	  35e20	cdtest.exe
 175024	   2160	  29072	 206256	  325b0	capture.exe

---

 c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360.cfg     | 3 +++
 c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360_040.cfg | 3 +++
 c/src/lib/libbsp/m68k/gen68360/make/custom/pgh360.cfg       | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360.cfg b/c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360.cfg
index d2da2e6..e98041f 100644
--- a/c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360.cfg
+++ b/c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360.cfg
@@ -9,3 +9,6 @@ include $(RTEMS_ROOT)/make/custom/default.cfg
 CPU_CFLAGS = -mcpu=cpu32
 
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
diff --git a/c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360_040.cfg b/c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360_040.cfg
index b1bf318..23cf917 100644
--- a/c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360_040.cfg
+++ b/c/src/lib/libbsp/m68k/gen68360/make/custom/gen68360_040.cfg
@@ -10,3 +10,6 @@ CPU_CFLAGS = -mcpu=68040
 include $(RTEMS_ROOT)/make/custom/default.cfg
 
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
diff --git a/c/src/lib/libbsp/m68k/gen68360/make/custom/pgh360.cfg b/c/src/lib/libbsp/m68k/gen68360/make/custom/pgh360.cfg
index c0b3409..a9f7508 100644
--- a/c/src/lib/libbsp/m68k/gen68360/make/custom/pgh360.cfg
+++ b/c/src/lib/libbsp/m68k/gen68360/make/custom/pgh360.cfg
@@ -9,3 +9,6 @@ include $(RTEMS_ROOT)/make/custom/default.cfg
 CPU_CFLAGS = -mcpu32
 
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections




More information about the vc mailing list