[rtems commit] powerpc/virtex4: Add per-section compilation and linking support.

Joel Sherrill joel at rtems.org
Sat Jan 23 20:36:30 UTC 2016


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

Author:    Ralph Holmes <ralph at ybden.com>
Date:      Sat Jan 23 18:38:17 2016 +0000

powerpc/virtex4: Add per-section compilation and linking support.

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 116817	   9206	   7137	 133160	  20828	base_sp.exe
 132977	   8018	   6745	 147740	  2411c	hello.exe
  51169	   5066	   3205	  59440	   e830	minimum.exe
 567889	  80534	  19393	 667816	  a30a8	fileio.exe
 139841	  10950	   7241	 158032	  26950	nsecs.exe
 205585	  21326	   7805	 234716	  394dc	paranoia.exe
 119985	   9374	   7169	 136528	  21550	ticker.exe
 119345	   9378	  10561	 139284	  22014	unlimited.exe
 891953	 193036	  14421	1099410	 10c692	cxx_iostream.exe
 225553	  26678	   7425	 259656	  3f648	cdtest.exe
 221617	  23046	   8965	 253628	  3debc	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
 104769	   7808	   7117	 119694	  1d38e	base_sp.exe
 118753	   6596	   6717	 132066	  203e2	hello.exe
  39905	   3720	   3185	  46810	   b6da	minimum.exe
 546769	  77148	  19113	 643030	  9cfd6	fileio.exe
 129329	   9534	   7221	 146084	  23aa4	nsecs.exe
 192785	  19908	   7781	 220474	  35d3a	paranoia.exe
 109025	   7980	   7149	 124154	  1e4fa	ticker.exe
 105793	   7884	  10533	 124210	  1e532	unlimited.exe
 559973	  38860	  13609	 612442	  9585a	cxx_iostream.exe
 215369	  17392	   7405	 240166	  3aa26	cdtest.exe
 207121	  21408	   8945	 237474	  39fa2	capture.exe

---

 c/src/lib/libbsp/powerpc/virtex4/make/custom/virtex4.cfg | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/c/src/lib/libbsp/powerpc/virtex4/make/custom/virtex4.cfg b/c/src/lib/libbsp/powerpc/virtex4/make/custom/virtex4.cfg
index 713c297..5cf0206 100644
--- a/c/src/lib/libbsp/powerpc/virtex4/make/custom/virtex4.cfg
+++ b/c/src/lib/libbsp/powerpc/virtex4/make/custom/virtex4.cfg
@@ -10,6 +10,9 @@ CPU_CFLAGS = -mcpu=405 -Dppc405
 
 # optimize flag: typically -O2
 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
 
 # Miscellaneous additions go here
 define bsp-post-link



More information about the vc mailing list