Bootloader cleanup (UNTESTED!)

- Clean up bootloader asm
- Remove fromflash.c - it's not worth doing in C, do it in ASM
- Clean up linker script
- Force use of symbol inside bootphase2 (otherwise linker
  garbage-collects it)
- Link bootloader with gcc instead of ld
This commit is contained in:
marcansoft 2010-02-26 15:14:47 +00:00
commit 86d3195518
5 changed files with 87 additions and 114 deletions

View file

@ -7,7 +7,7 @@
#-----------------------------------------------------------------------------
# DO NOT use thumb mode in the phase 1 bootloader since that generates a section with glue code
ARMSRC = fromflash.c
ARMSRC =
THUMBSRC = usb.c bootrom.c
ASMSRC = ram-reset.s flash-reset.s
@ -27,7 +27,7 @@ include ../common/Makefile.common
all: $(OBJDIR)/bootrom.s19
$(OBJDIR)/bootrom.elf: $(VERSIONOBJ) $(ASMOBJ) $(ARMOBJ) $(THUMBOBJ)
$(LD) -g -Tldscript-flash --oformat elf32-littlearm -Map=$(patsubst %.elf,%.map,$@) -o $@ $^
$(CC) $(LDFLAGS) -Wl,-T,ldscript-flash,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^ $(LIBS)
clean:
$(DELETE) $(OBJDIR)$(PATHSEP)*.o