compile cache.c -mpcrel

This commit is contained in:
Markus Fröschle
2012-11-03 22:35:47 +00:00
parent 4975cd280d
commit 809e93715e
3 changed files with 6 additions and 1 deletions

View File

@@ -99,6 +99,8 @@ $(OBJDIR)/init_fpga.o: CFLAGS += -mbitfield
# compile printf pc-relative so it can be used as well before and after copy of BaS
$(OBJDIR)/printf.o: CFLAGS += -mpcrel
# the same for flush_and_invalidate_cache()
$(OBJDIR)/cache.c: CFLAGS += -mpcrel
$(OBJDIR)/%.o:$(SRCDIR)/%.c
$(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@

View File

@@ -68,7 +68,6 @@ SECTIONS {
objs/startcf.o(.text) /* this one is the entry point so it must be the first */
objs/sysinit.o(.text)
objs/init_fpga.o(.text)
objs/cache.o(.text)
#if (FORMAT == elf32-m68k)
*(.rodata)
*(.rodata.*)
@@ -85,6 +84,8 @@ SECTIONS {
objs/printf_helper.o(.text)
_xprintf_before_copy = _xprintf - (_BaS - LOADADDR(.bas));
_display_progress_before_copy = _display_progress - (_BaS - LOADADDR(.bas));
objs/cache.o(.text)
_flush_and_invalidate_caches_before_copy = _flush_and_invalidate_caches - (_BaS - LOADADDR(.bas));
objs/sd_card.o(.text)
objs/mmu.o(.text)
objs/exceptions.o(.text)

View File

@@ -14,6 +14,8 @@
extern void xprintf_before_copy(const char *fmt, ...);
#define xprintf xprintf_before_copy
extern void flush_and_invalidate_caches_before_copy(void);
#define flush_and_invalidate_caches flush_and_invalidate_caches_before_copy
#define UNUSED(x) (void)(x) /* Unused variable */