mips/rbtx4938: Add per-section compilation and linking support.

The size of the sample executables without this option were:

   text	   data	    bss	    dec	    hex	filename
 105928	   7448	  12304	 125680	  1eaf0	base_sp.exe
 114276	   6464	  11904	 132644	  20624	hello.exe
  64908	   4248	   8592	  77748	  12fb4	minimum.exe
 568808	  80292	  24680	 673780	  a47f4	fileio.exe
 128232	   9936	  12472	 150640	  24c70	nsecs.exe
 162840	  20132	  12976	 195948	  2fd6c	paranoia.exe
 109944	   8300	  12352	 130596	  1fe24	ticker.exe
 109880	   7676	  15728	 133284	  208a4	unlimited.exe
1035584	  48120	  19681	1103385	 10d619	cxx_iostream.exe
 216136	  18520	  12609	 247265	  3c5e1	cdtest.exe
 205784	  22188	  14180	 242152	  3b1e8	capture.exe

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

   text	   data	    bss	    dec	    hex	filename
  93464	   6776	  12188	 112428	  1b72c	base_sp.exe
  99480	   5780	  11788	 117048	  1c938	hello.exe
  40616	   3208	   8512	  52336	   cc70	minimum.exe
 545448	  77224	  24130	 646802	  9de92	fileio.exe
 117528	   9224	  12340	 139092	  21f54	nsecs.exe
 149784	  19428	  12804	 182016	  2c700	paranoia.exe
  98760	   7616	  12204	 118580	  1cf34	ticker.exe
  95672	   6976	  15620	 118268	  1cdfc	unlimited.exe
 530280	  38896	  18753	 587929	  8f899	cxx_iostream.exe
 198832	  16492	  12473	 227797	  379d5	cdtest.exe
 190632	  21160	  14036	 225828	  37224	capture.exe
This commit is contained in:
Ralph Holmes
2016-01-21 19:25:55 +00:00
committed by Joel Sherrill
parent 5ebdd28996
commit b963c8dd0c

View File

@@ -12,6 +12,9 @@ CPU_CFLAGS = -mips3 -G0 -EL
# optimize flag: typically -O2 # optimize flag: typically -O2
CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
LDFLAGS = -Wl,--gc-sections
define bsp-post-link define bsp-post-link
$(OBJCOPY) --srec-len=30 -O srec $@ $(basename $@)$(DOWNEXT) $(OBJCOPY) --srec-len=30 -O srec $@ $(basename $@)$(DOWNEXT)