[rtems commit] m32c/m32csim: Add per-section compilation and linking support
Joel Sherrill
joel at rtems.org
Fri Mar 11 20:14:54 UTC 2016
Module: rtems
Branch: master
Commit: 4a199a92d4f69639a1e483cbabb97410204ffa85
Changeset: http://git.rtems.org/rtems/commit/?id=4a199a92d4f69639a1e483cbabb97410204ffa85
Author: Joel Sherrill <joel at rtems.org>
Date: Thu Mar 10 16:08:29 2016 -0600
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
---
c/src/lib/libbsp/m32c/m32cbsp/make/custom/m32csim.cfg | 3 +++
1 file changed, 3 insertions(+)
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 cee695d..491f000 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
More information about the vc
mailing list