From d0aab2b3a952969da1fc141b5f20ccd2b59b49cd Mon Sep 17 00:00:00 2001 From: Aun-Ali Zaidi Date: Sat, 9 Jan 2016 12:16:13 -0600 Subject: arm/edb7312: Add per-section compilation and linking support The size of the sample executables without this option were: text data bss dec hex filename 60732 1636 16714848 16777216 1000000 minimum.exe 93700 1868 16681632 16777200 fffff0 base_sp.exe 114076 1956 16661156 16777188 ffffe4 nsecs.exe 192608 2352 16582244 16777204 fffff4 capture.exe 205980 1896 16569312 16777188 ffffe4 cdtest.exe 182060 2252 16592900 16777212 fffffc paranoia.exe 106596 1844 16668772 16777212 fffffc hello.exe 564540 5780 16206884 16777204 fffff4 fileio.exe 97136 1868 16678212 16777216 1000000 ticker.exe 273136 6656 16497408 16777200 fffff0 loopback.exe 592916 2112 16182176 16777204 fffff4 cxx_iostream.exe 451920 12764 16312512 16777196 ffffec pppd.exe 95812 1900 16679488 16777200 fffff0 unlimited.exe The size of the sample executables with this option enabled were: text data bss dec hex filename 32020 1208 16743968 16777196 ffffec minimum.exe 87720 1708 16687780 16777208 fffff8 base_sp.exe 108192 1796 16667200 16777188 ffffe4 nsecs.exe 184488 2184 16590532 16777204 fffff4 capture.exe 197940 1744 16577504 16777188 ffffe4 cdtest.exe 175420 2084 16599684 16777188 ffffe4 paranoia.exe 98044 1684 16677476 16777204 fffff4 hello.exe 548124 5620 16223460 16777204 fffff4 fileio.exe 91140 1708 16684352 16777200 fffff0 ticker.exe 252968 6408 16517824 16777200 fffff0 loopback.exe 414640 1952 16360612 16777204 fffff4 cxx_iostream.exe 418608 12472 16346116 16777196 ffffec pppd.exe 87616 1740 16687844 16777200 fffff0 unlimited.exe --- c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg b/c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg index bc596aa539..832f47bdde 100644 --- a/c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg +++ b/c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg @@ -14,3 +14,7 @@ CPU_CFLAGS = -mcpu=$(RTEMS_CPU_MODEL) # optimize flag: typically -O2 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 -- cgit v1.2.3