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

Joel Sherrill joel at rtems.org
Sat Jan 9 15:32:55 UTC 2016


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

Author:    Aun-Ali Zaidi <admin at kodeit.net>
Date:      Wed Jan  6 22:54:28 2016 -0600

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

Both the BeagleBoards and the BeagleBones produce identical sized binaries.

BeagleBoard Series
==================

The size of the sample executables without this option were:

  text     data    bss          dec             hex     filename
  62616	   1512	264177020	264241148	fbffffc	minimum.exe
  94228	   1852	264145056	264241136	fbffff0	base_sp.exe
 114556	   1940	264124632	264241128	fbfffe8	nsecs.exe
 191972	   2328	264046828	264241128	fbfffe8	capture.exe
 206412	   1880	264032848	264241140	fbffff4	cdtest.exe
 180680	   2228	264058220	264241128	fbfffe8	paranoia.exe
 107280	   1716	264132132	264241128	fbfffe8	hello.exe
 554392	   5764	263680988	264241144	fbffff8	fileio.exe
  97888	   1852	264141396	264241136	fbffff0	ticker.exe
 271728	   6624	263962784	264241136	fbffff0	loopback.exe
 593260	   1984	263645896	264241140	fbffff4	cxx_iostream.exe
 448400	  12740	263779992	264241132	fbfffec	pppd.exe
  96224	   1772	264143156	264241152	fc00000	unlimited.exe

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

  text     data    bss          dec             hex     filename
  30560	   1212	264209364	264241136	fbffff0	minimum.exe
  87656	   1828	264151660	264241144	fbffff8	base_sp.exe
 108076	   1916	264131144	264241136	fbffff0	nsecs.exe
 183540	   2296	264055292	264241128	fbfffe8	capture.exe
 197908	   1856	264041384	264241148	fbffffc	cdtest.exe
 173976	   2204	264064956	264241136	fbffff0	paranoia.exe
  99752	   1684	264139692	264241128	fbfffe8	hello.exe
 537888	   5740	263697524	264241152	fc00000	fileio.exe
  91312	   1828	264148004	264241144	fbffff8	ticker.exe
 251360	   6512	263983256	264241128	fbfffe8	loopback.exe
 416176	   1952	263823012	264241140	fbffff4	cxx_iostream.exe
 415312	  12584	263813252	264241148	fbffffc	pppd.exe
  89068	   1740	264150344	264241152	fc00000	unlimited.exe

BeagleBone Series
=================

The size of the sample executables without this option were:

  text     data    bss          dec             hex     filename
  62616	   1512	264177020	264241148	fbffffc	minimum.exe
  94520	   1932	264144700	264241152	fc00000	base_sp.exe
 114844	   2020	264124280	264241144	fbffff8	nsecs.exe
 192260	   2408	264046476	264241144	fbffff8	capture.exe
 206708	   1960	264032456	264241124	fbfffe4	cdtest.exe
 180976	   2308	264057860	264241144	fbffff8	paranoia.exe
 107280	   1716	264132132	264241128	fbfffe8	hello.exe
 554688	   5844	263680596	264241128	fbfffe8	fileio.exe
  98180	   1932	264141040	264241152	fc00000	ticker.exe
 272016	   6704	263962432	264241152	fc00000	loopback.exe
 593260	   1984	263645896	264241140	fbffff4	cxx_iostream.exe
 448696	  12820	263779632	264241148	fbffffc	pppd.exe
  96224	   1772	264143156	264241152	fc00000	unlimited.exe

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

  text     data    bss          dec             hex     filename
  30560	   1212	264209364	264241136	fbffff0	minimum.exe
  87944	   1908	264151276	264241128	fbfffe8	base_sp.exe
 108364	   1996	264130792	264241152	fc00000	nsecs.exe
 183828	   2376	264054940	264241144	fbffff8	capture.exe
 198196	   1936	264041000	264241132	fbfffec	cdtest.exe
 174264	   2284	264064604	264241152	fc00000	paranoia.exe
  99752	   1684	264139692	264241128	fbfffe8	hello.exe
 538176	   5820	263697140	264241136	fbffff0	fileio.exe
  91600	   1908	264147620	264241128	fbfffe8	ticker.exe
 251648	   6592	263982904	264241144	fbffff8	loopback.exe
 416176	   1952	263823012	264241140	fbffff4	cxx_iostream.exe
 415600	  12664	263812868	264241132	fbfffec	pppd.exe
  89068	   1740	264150344	264241152	fc00000	unlimited.exe

---

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

diff --git a/c/src/lib/libbsp/arm/beagle/make/custom/beagle.inc b/c/src/lib/libbsp/arm/beagle/make/custom/beagle.inc
index 3610016..45d1408 100644
--- a/c/src/lib/libbsp/arm/beagle/make/custom/beagle.inc
+++ b/c/src/lib/libbsp/arm/beagle/make/custom/beagle.inc
@@ -9,3 +9,7 @@ RTEMS_CPU = arm
 CPU_CFLAGS = -mcpu=cortex-a8
 
 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