m68k/mcf5329:Add per-section compilation and linking support (GCI 2018)

The size of the sample executables without this option were:

   text    data     bss     dec     hex filename
  87654    1152   11968  100774   189a6 base_sp.exe
 203318    2112   14896  220326   35ca6 capture.exe
 257014    2912   12960  272886   429f6 cdtest.exe
 865750   21888   19648  907286   dd816 cxx_iostream.exe
 569078    4640   24352  598070   92036 fileio.exe
 121094    1520   12048  134662   20e06 hello.exe
  70614    1024    8768   80406   13a16 minimum.exe
 110806    1632   12080  124518   1e666 nsecs.exe
 196326    1920   12688  210934   337f6 paranoia.exe
  90406    1184   12000  103590   194a6 ticker.exe
  89958    1136   15808  106902   1a196 unlimited.exe

The size of the sample executables with this option were:

   text    data     bss     dec     hex filename
  83270    1152   11888   96310   17836 base_sp.exe
 189974    2112   14864  206950   32866 capture.exe
 188982    2144   12928  204054   31d16 cdtest.exe
 188662    2240   13072  203974   31cc6 cxx_iostream.exe
 556822    4624   24048  585494   8ef16 fileio.exe
 112422    1520   12016  125958   1ec06 hello.exe
  66086    1008    8688   75782   12806 minimum.exe
 104982    1632   11984  118598   1cf46 nsecs.exe
 187958    1904   12656  202518   31716 paranoia.exe
  85766    1184   11920   98870   18236 ticker.exe
  88406    1120   15776  105302   19b56 unlimited.exe

Closes #2569
This commit is contained in:
Shashvat Jain
2018-11-28 21:06:31 +05:30
committed by Joel Sherrill
parent e80d34eb55
commit cc119eb1cc

View File

@@ -8,7 +8,7 @@ RTEMS_CPU=m68k
include $(RTEMS_ROOT)/make/custom/default.cfg
# This contains the compiler options necessary to select the CPU model
# and (hopefully) optimize for it.
# and (hopefully) optimize for it.
#CPU_CFLAGS = -mcpu=5329
CPU_CFLAGS = -mcpu=5307
@@ -17,8 +17,8 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
# FIXME: Disabled because linkcmds lacks proper KEEP() directives. See #2569.
# The following two lines enable compiling and linking on per element.
# CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
# LDFLAGS = -Wl,--gc-sections
CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
LDFLAGS = -Wl,--gc-sections
# This defines the operations performed on the linked executable.
# is currently required.