summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel@rtems.org>2016-03-10 16:08:29 -0600
committerJoel Sherrill <joel@rtems.org>2016-03-10 18:10:14 -0600
commit4a199a92d4f69639a1e483cbabb97410204ffa85 (patch)
treeda56a4ba77ca4754bda04fa0b5cff3fc6994d395
parentlm32/lm32_evr: Add per-section compilation and linking support (diff)
downloadrtems-4a199a92d4f69639a1e483cbabb97410204ffa85.tar.bz2
m32c/m32csim: Add per-section compilation and linking support
updates #2577. For the m32csim BSP variant without this option sample executables sizes were as follows: text data bss dec hex filename 143148 1118 4664 148930 245c2 ticker.exe 55140 584 876 56600 dd18 minimum.exe 268638 1804 6598 277040 43a30 capture.exe 161226 1184 4712 167122 28cd2 nsecs.exe 389500 1518 5176 396194 60ba2 paranoia.exe 135256 1118 4638 141012 226d4 base_sp.exe 139728 1146 6482 147356 23f9c unlimited.exe 165500 1092 4638 171230 29cde hello.exe For the m32csim BSP variant with this option sample executables sizes were as follows: text data bss dec hex filename 137586 1096 4526 143208 22f68 ticker.exe 31136 454 738 32328 7e48 minimum.exe 252540 1764 6458 260762 3fa9a capture.exe 155716 1162 4570 161448 276a8 nsecs.exe 378606 1492 5038 385136 5e070 paranoia.exe 124526 1092 4500 130118 1fc46 base_sp.exe 128746 1120 6344 136210 21412 unlimited.exe 154278 1066 4500 159844 27064 hello.exe
-rw-r--r--c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg3
1 files changed, 3 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg b/c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg
index cee695db7d..491f000597 100644
--- a/c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg
+++ b/c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg
@@ -15,3 +15,6 @@ CPU_CFLAGS = -mcpu=m32cm
# see GCC PR37665
#CFLAGS_OPTIMIZE_V = -Os -g
CFLAGS_OPTIMIZE_V = -O0 -g
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections