diff --git a/Makefile b/Makefile index a917d56..85722db 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ TARGET = armboot.bin ELF = armboot.elf OBJECTS = start.o main.o ipc.o vsprintf.o string.o gecko.o memory.o memory_asm.o \ utils_asm.o utils.o ff.o diskio.o sdhc.o powerpc_elf.o powerpc.o panic.o irq.o irq_asm.o \ - exception.o exception_asm.o seeprom.o crypto.o nand.o boot2.o + exception.o exception_asm.o seeprom.o crypto.o nand.o boot2.o ldhack.o $(TARGET) : $(ELF) $(ELFLOADER) @echo "MAKEBIN $@" diff --git a/ldhack.c b/ldhack.c new file mode 100644 index 0000000..e5402b9 --- /dev/null +++ b/ldhack.c @@ -0,0 +1,4 @@ +/* This makes LD avoid including the exception unwinder for long long division support */ + +char __aeabi_unwind_cpp_pr0[0]; + diff --git a/miniios.ld b/miniios.ld index 139ed41..35171e3 100644 --- a/miniios.ld +++ b/miniios.ld @@ -110,5 +110,12 @@ SECTIONS __excstack_addr = .; } >sram2 + /DISCARD/ : + { + *(.ARM.exidx*) + *(.ARM.extab*) + } + } + diff --git a/vsprintf.c b/vsprintf.c index 8d09a41..a72af67 100644 --- a/vsprintf.c +++ b/vsprintf.c @@ -99,11 +99,11 @@ #define VA_START(ap, last) va_start(ap, last) #define VA_SHIFT(ap, value, type) /* No-op for ANSI C. */ -#define ULLONG unsigned long -#define UINTMAX_T unsigned long -#define UINTMAX_MAX ULONG_MAX -#define LLONG long -#define INTMAX_T long +#define ULLONG unsigned long long +#define UINTMAX_T unsigned long long +#define UINTMAX_MAX ULLONG_MAX +#define LLONG long long +#define INTMAX_T long long /* Support for uintptr_t. */ #ifndef UINTPTR_T