From 07ecbd7c92e5b4a99e42c6a0f4e4e04f02015988 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Wed, 6 Jul 2005 05:51:38 +0000 Subject: [PATCH] moved scripts to toolchain dirs --- dka-crtls/Makefile | 11 - dka-crtls/ds_arm7.ld | 172 ------------- dka-crtls/ds_arm7.specs | 8 - dka-crtls/ds_arm7_crt0.s | 94 ------- dka-crtls/ds_arm9.ld | 228 ----------------- dka-crtls/ds_arm9.specs | 8 - dka-crtls/ds_arm9_crt0.s | 258 ------------------- dka-crtls/ds_cart.ld | 197 --------------- dka-crtls/ds_cart.specs | 8 - dka-crtls/ds_cart_crt0.s | 161 ------------ dka-crtls/er_crt0.s | 56 ----- dka-crtls/gba.specs | 8 - dka-crtls/gba_cart.ld | 298 ---------------------- dka-crtls/gba_crt0.s | 248 ------------------ dka-crtls/gba_er.ld | 50 ---- dka-crtls/gba_er.specs | 8 - dka-crtls/gba_mb.ld | 284 --------------------- dka-crtls/gba_mb.specs | 8 - dka-crtls/gp32.ld | 152 ------------ dka-crtls/gp32.specs | 8 - dka-crtls/gp32_crt0.s | 74 ------ dka-crtls/gp32_gpsdk.ld | 197 --------------- dka-crtls/gp32_gpsdk.specs | 8 - dka-crtls/gp32_gpsdk_crt0.s | 246 ------------------ dka-rules/base_rules | 58 ----- dka-rules/ds_rules | 23 -- dka-rules/gba_rules | 19 -- dka-rules/gp32_rules | 18 -- dka-scripts/build-crtls.sh | 37 --- dka-scripts/build-gcc.sh | 95 ------- dka-scripts/build-tools.sh | 16 -- dkp-crtls/gcn.ld | 302 ---------------------- dkp-crtls/gcn_crt0.o | Bin 2308 -> 0 bytes dkp-crtls/gcn_crt0.s | 483 ------------------------------------ dkp-crtls/ogc.ld | 348 -------------------------- dkp-crtls/specs | 355 -------------------------- dkp-rules/base_rules | 55 ---- dkp-rules/gamecube_rules | 10 - dkp-scripts/build-crtls.sh | 26 -- dkp-scripts/build-gcc.sh | 94 ------- 40 files changed, 4729 deletions(-) delete mode 100644 dka-crtls/Makefile delete mode 100644 dka-crtls/ds_arm7.ld delete mode 100644 dka-crtls/ds_arm7.specs delete mode 100644 dka-crtls/ds_arm7_crt0.s delete mode 100644 dka-crtls/ds_arm9.ld delete mode 100644 dka-crtls/ds_arm9.specs delete mode 100644 dka-crtls/ds_arm9_crt0.s delete mode 100644 dka-crtls/ds_cart.ld delete mode 100644 dka-crtls/ds_cart.specs delete mode 100644 dka-crtls/ds_cart_crt0.s delete mode 100644 dka-crtls/er_crt0.s delete mode 100644 dka-crtls/gba.specs delete mode 100644 dka-crtls/gba_cart.ld delete mode 100644 dka-crtls/gba_crt0.s delete mode 100644 dka-crtls/gba_er.ld delete mode 100644 dka-crtls/gba_er.specs delete mode 100644 dka-crtls/gba_mb.ld delete mode 100644 dka-crtls/gba_mb.specs delete mode 100644 dka-crtls/gp32.ld delete mode 100644 dka-crtls/gp32.specs delete mode 100644 dka-crtls/gp32_crt0.s delete mode 100644 dka-crtls/gp32_gpsdk.ld delete mode 100644 dka-crtls/gp32_gpsdk.specs delete mode 100644 dka-crtls/gp32_gpsdk_crt0.s delete mode 100644 dka-rules/base_rules delete mode 100644 dka-rules/ds_rules delete mode 100644 dka-rules/gba_rules delete mode 100644 dka-rules/gp32_rules delete mode 100644 dka-scripts/build-crtls.sh delete mode 100644 dka-scripts/build-gcc.sh delete mode 100644 dka-scripts/build-tools.sh delete mode 100644 dkp-crtls/gcn.ld delete mode 100644 dkp-crtls/gcn_crt0.o delete mode 100644 dkp-crtls/gcn_crt0.s delete mode 100644 dkp-crtls/ogc.ld delete mode 100644 dkp-crtls/specs delete mode 100644 dkp-rules/base_rules delete mode 100644 dkp-rules/gamecube_rules delete mode 100644 dkp-scripts/build-crtls.sh delete mode 100644 dkp-scripts/build-gcc.sh diff --git a/dka-crtls/Makefile b/dka-crtls/Makefile deleted file mode 100644 index 56a5081..0000000 --- a/dka-crtls/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -PREFIX := arm-elf- -export CC := $(PREFIX)gcc -export CXX := $(PREFIX)g++ -export AR := $(PREFIX)ar -export OBJCOPY := $(PREFIX)objcopy - -all: - $(CC) -x assembler-with-cpp -marm -c $(CRT)_crt0.s -o$(CRT)_crt0.o - $(CC) -x assembler-with-cpp -marm -mthumb-interwork -c $(CRT)_crt0.s -o interwork/$(CRT)_crt0.o - $(CC) -x assembler-with-cpp -mthumb -c $(CRT)_crt0.s -o thumb/$(CRT)_crt0.o - $(CC) -x assembler-with-cpp -mthumb -mthumb-interwork -c $(CRT)_crt0.s -o thumb/interwork/$(CRT)_crt0.o diff --git a/dka-crtls/ds_arm7.ld b/dka-crtls/ds_arm7.ld deleted file mode 100644 index 8981ecb..0000000 --- a/dka-crtls/ds_arm7.ld +++ /dev/null @@ -1,172 +0,0 @@ -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) - -MEMORY { - - rom : ORIGIN = 0x08000000, LENGTH = 32M - iwram : ORIGIN = 0x03800000, LENGTH = 64K - ewram : ORIGIN = 0x02040000, LENGTH = 4M -} -__iwram_start = 0x03800000; -__iwram_end = 0x03810000; - -__sp_irq = __iwram_end - 0x60; -__sp_svc = __sp_irq - 0x100; -__sp_usr = __sp_svc - 0x100; - -SECTIONS -{ - .init : - { - __text_start = . ; - KEEP (*(.init)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - .plt : { *(.plt) } >iwram = 0xff - - .text : /* ALIGN (4): */ - { - - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - *(.glue_7) - *(.glue_7t) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - .fini : - { - KEEP (*(.fini)) - } >iwram =0xff - - __text_end = . ; - - .rodata : - { - *(.rodata) - *all.rodata*(*) - *(.roda) - *(.rodata.*) - *(.gnu.linkonce.r*) - SORT(CONSTRUCTORS) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - .ctors : - { - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - .eh_frame : - { - KEEP (*(.eh_frame)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - .gcc_except_table : - { - *(.gcc_except_table) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - .jcr : { KEEP (*(.jcr)) } >iwram = 0 - .got : { *(.got.plt) *(.got) } >iwram = 0 - - - .iwram ALIGN(4) : - { - __iwram_start = ABSOLUTE(.) ; - *(.iwram) - *iwram.*(.text) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - __iwram_end = . ; - - .data ALIGN(4) : { - __data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - CONSTRUCTORS - . = ALIGN(4); - } >iwram = 0xff - - __data_end = . ; - - - .bss ALIGN(4) : - { - __bss_start = ABSOLUTE(.); - __bss_start__ = ABSOLUTE(.); - *(.dynbss) - *(.gnu.linkonce.b*) - *(COMMON) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram - - __bss_end = . ; - __bss_end__ = . ; - - _end = . ; - __end__ = . ; - PROVIDE (end = _end); - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .stack 0x80000 : { _stack = .; *(.stack) } - /* These must appear regardless of . */ -} diff --git a/dka-crtls/ds_arm7.specs b/dka-crtls/ds_arm7.specs deleted file mode 100644 index eb605fd..0000000 --- a/dka-crtls/ds_arm7.specs +++ /dev/null @@ -1,8 +0,0 @@ -%rename link old_link - -*link: -%(old_link) -T ds_arm7.ld%s - -*startfile: -ds_arm7_crt0%O%s crti%O%s crtbegin%O%s - diff --git a/dka-crtls/ds_arm7_crt0.s b/dka-crtls/ds_arm7_crt0.s deleted file mode 100644 index 239729a..0000000 --- a/dka-crtls/ds_arm7_crt0.s +++ /dev/null @@ -1,94 +0,0 @@ -@--------------------------------------------------------------------------------- - .section ".init" - .global _start -@--------------------------------------------------------------------------------- - .align 4 - .arm -@--------------------------------------------------------------------------------- -_start: -@--------------------------------------------------------------------------------- - mov r0, #0x04000000 @ IME = 0; - add r0, r0, #0x208 - strh r0, [r0] - - mov r0, #0x12 @ Switch to IRQ Mode - msr cpsr, r0 - ldr sp, =__sp_irq @ Set IRQ stack - - mov r0, #0x13 @ Switch to SVC Mode - msr cpsr, r0 - ldr sp, =__sp_svc @ Set SVC stack - - mov r0, #0x1F @ Switch to System Mode - msr cpsr, r0 - ldr sp, =__sp_usr @ Set user stack - - ldr r0, =__bss_start @ Clear BSS section to 0x00 - ldr r1, =__bss_end - sub r1, r1, r0 - bl ClearMem - - ldr r3, =_init @ global constructors - bl _call_via_r3 - - mov r0, #0 @ int argc - mov r1, #0 @ char *argv[] - ldr r3, =main - bl _call_via_r3 @ jump to user code - - @ If the user ever returns, return to flash cartridge - mov r0, #0x08000000 - bx r0 - -@--------------------------------------------------------------------------------- -@ Clear memory to 0x00 if length != 0 -@ r0 = Start Address -@ r1 = Length -@--------------------------------------------------------------------------------- -ClearMem: -@--------------------------------------------------------------------------------- - mov r2, #3 @ Round down to nearest word boundary - add r1, r1, r2 @ Shouldn't be needed - bics r1, r1, r2 @ Clear 2 LSB (and set Z) - bxeq lr @ Quit if copy size is 0 - - mov r2, #0 -ClrLoop: - stmia r0!, {r2} - subs r1, r1, #4 - bne ClrLoop - bx lr - -@--------------------------------------------------------------------------------- -@ Copy memory if length != 0 -@ r1 = Source Address -@ r2 = Dest Address -@ r4 = Dest Address + Length -@--------------------------------------------------------------------------------- -CopyMemCheck: -@--------------------------------------------------------------------------------- - sub r3, r4, r2 @ Is there any data to copy? -@--------------------------------------------------------------------------------- -@ Copy memory -@ r1 = Source Address -@ r2 = Dest Address -@ r3 = Length -@--------------------------------------------------------------------------------- -CopyMem: -@--------------------------------------------------------------------------------- - mov r0, #3 @ These commands are used in cases where - add r3, r3, r0 @ the length is not a multiple of 4, - bics r3, r3, r0 @ even though it should be. - bxeq lr @ Length is zero, so exit -CIDLoop: - ldmia r1!, {r0} - stmia r2!, {r0} - subs r3, r3, #4 - bne CIDLoop - bx lr - -@--------------------------------------------------------------------------------- - .align - .pool - .end -@--------------------------------------------------------------------------------- diff --git a/dka-crtls/ds_arm9.ld b/dka-crtls/ds_arm9.ld deleted file mode 100644 index 716168f..0000000 --- a/dka-crtls/ds_arm9.ld +++ /dev/null @@ -1,228 +0,0 @@ -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) - -MEMORY { - - rom : ORIGIN = 0x08000000, LENGTH = 32M - iwram : ORIGIN = 0x037f8000, LENGTH = 32K - ewram : ORIGIN = 0x02000000, LENGTH = 4M - 4k - dtcm : ORIGIN = 0x00800000, LENGTH = 16K - itcm : ORIGIN = 0x00000000, LENGTH = 32K -} - -__itcm_start = 0x00000000; -__iwram_start = 0x037f8000; -__iwram_end = 0x03800000; -__ewram_end = 0x02400000; -__eheap_end = 0x023ff000; -__dtcm_start = 0x00800000; -__dtcm_end = 0x00804000; - -__sp_svc = __dtcm_end - 0x100; -__sp_irq = __sp_svc - 0x100; -__sp_usr = __sp_irq - 0x100; - -SECTIONS -{ - .init : - { - __text_start = . ; - KEEP (*(.init)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - .plt : { *(.plt) } >ewram = 0xff - - .text : /* ALIGN (4): */ - { - - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - *(.glue_7) - *(.glue_7t) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - .fini : - { - KEEP (*(.fini)) - } >ewram =0xff - - __text_end = . ; - - .rodata : - { - *(.rodata) - *all.rodata*(*) - *(.roda) - *(.rodata.*) - *(.gnu.linkonce.r*) - SORT(CONSTRUCTORS) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - .ctors : - { - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - .eh_frame : - { - KEEP (*(.eh_frame)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - .gcc_except_table : - { - *(.gcc_except_table) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - .jcr : { KEEP (*(.jcr)) } >ewram = 0 - .got : { *(.got.plt) *(.got) } >ewram = 0 - - .ewram ALIGN(4) : - { - __ewram_start = ABSOLUTE(.) ; - *(.ewram) - *ewram.*(.text) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - __iwram_lma = . ; - - .iwram __iwram_start : AT (__iwram_lma) - { - __iwram_start = ABSOLUTE(.) ; - *(.iwram) - *iwram.*(.text) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - __iwram_end = . ; - - __dtcm_lma = __iwram_lma + SIZEOF(.iwram); - - .dtcm __dtcm_start : AT (__dtcm_lma) - { - __dtcm_start = ABSOLUTE(.); - *(.dtcm) - *(.dtcm.*) - . = ALIGN(4); - } >dtcm = 0xff - __dtcm_end = . ; - - __data_lma = __dtcm_lma + SIZEOF(.dtcm) ; - - .data ALIGN(4) : AT (__data_lma) - { - __data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - CONSTRUCTORS - . = ALIGN(4); - } >dtcm = 0xff - - __data_end = . ; - - - .bss ALIGN(4) : - { - __bss_start = ABSOLUTE(.); - __bss_start__ = ABSOLUTE(.); - *(.dynbss) - *(.gnu.linkonce.b*) - *(COMMON) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >dtcm - - __bss_end = . ; - __bss_end__ = . ; - - __itcm_lma = __data_lma + SIZEOF(.data); - - .itcm __itcm_start : AT (__itcm_lma) - { - __itcm_start = ABSOLUTE(.); - *(.itcm) - *(.itcm.*) - . = ALIGN(4); - } >itcm = 0xff - __itcm_end = . ; - - - __sbss_lma = __itcm_lma + SIZEOF(.itcm) ; - __appended_data = __itcm_lma + SIZEOF(.itcm) ; - - .sbss __sbss_lma : AT (__sbss_lma) - { - __sbss_start = ABSOLUTE(.); - *(.sbss) - . = ALIGN(4); - } >ewram - __sbss_end = . ; - - _end = . ; - __end__ = . ; - PROVIDE (end = _end); - - - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .stack 0x80000 : { _stack = .; *(.stack) } - /* These must appear regardless of . */ -} diff --git a/dka-crtls/ds_arm9.specs b/dka-crtls/ds_arm9.specs deleted file mode 100644 index 016f977..0000000 --- a/dka-crtls/ds_arm9.specs +++ /dev/null @@ -1,8 +0,0 @@ -%rename link old_link - -*link: -%(old_link) -T ds_arm9.ld%s - -*startfile: -ds_arm9_crt0%O%s crti%O%s crtbegin%O%s - diff --git a/dka-crtls/ds_arm9_crt0.s b/dka-crtls/ds_arm9_crt0.s deleted file mode 100644 index 59ae989..0000000 --- a/dka-crtls/ds_arm9_crt0.s +++ /dev/null @@ -1,258 +0,0 @@ -#define PAGE_4K (0b01011 << 1) -#define PAGE_8K (0b01100 << 1) -#define PAGE_16K (0b01101 << 1) -#define PAGE_32K (0b01110 << 1) -#define PAGE_64K (0b00111 << 1) -#define PAGE_128K (0b10000 << 1) -#define PAGE_256K (0b10001 << 1) -#define PAGE_512K (0b10010 << 1) -#define PAGE_1M (0b10011 << 1) -#define PAGE_2M (0b10100 << 1) -#define PAGE_4M (0b10101 << 1) -#define PAGE_8M (0b10110 << 1) -#define PAGE_16M (0b10111 << 1) -#define PAGE_32M (0b11000 << 1) -#define PAGE_64M (0b11001 << 1) -#define PAGE_128M (0b11010 << 1) -#define PAGE_256M (0b11011 << 1) -#define PAGE_512M (0b11100 << 1) -#define PAGE_1G (0b11101 << 1) -#define PAGE_2G (0b11110 << 1) -#define PAGE_4G (0b11111 << 1) - -@--------------------------------------------------------------------------------- - .section ".init" - .global _start -@--------------------------------------------------------------------------------- - .align 4 - .arm -@--------------------------------------------------------------------------------- -_start: -@--------------------------------------------------------------------------------- - mov r0, #0x04000000 @ IME = 0; - add r0, r0, #0x208 - strh r0, [r0] - - mov r1,#0 @ enable arm9 iwram - strb r1,[r0, #(0x247 - 0x208)] - - ldr r1, =0x00002078 @ disable DTCM and protection unit - mcr p15, 0, r1, c1, c0 - -@--------------------------------------------------------------------------------- -@ Protection Unit Setup added by Sasq -@--------------------------------------------------------------------------------- - @ Disable cache - mov r0, #0 - mcr p15, 0, r0, c7, c5, 0 @ Instruction cache - mcr p15, 0, r0, c7, c6, 0 @ Data cache - - @ Wait for write buffer to empty - mcr p15, 0, r0, c7, c10, 4 - - ldr r0, =0x0080000A - mcr p15, 0, r0, c9, c1 @ TCM base = 0x00800*4096, size = 16 KB -@--------------------------------------------------------------------------------- -@ Setup memory regions similar to Release Version -@ this code currently breaks dualis -@--------------------------------------------------------------------------------- - - @------------------------------------------------------------------------- - @ Region 0 - IO registers - @------------------------------------------------------------------------- - ldr r0,=( PAGE_64M | 0x04000000 | 1) - mcr p15, 0, r0, c6, c0, 0 - - @------------------------------------------------------------------------- - @ Region 1 - Main Memory - @------------------------------------------------------------------------- - ldr r0,=( PAGE_4M | 0x02000000 | 1) - mcr p15, 0, r0, c6, c1, 0 - - @------------------------------------------------------------------------- - @ Region 2 - iwram - @------------------------------------------------------------------------- - ldr r0,=( PAGE_32K | 0x037F8000 | 1) - mcr p15, 0, r0, c6, c2, 0 - - @------------------------------------------------------------------------- - @ Region 3 - DS Accessory (GBA Cart) - @------------------------------------------------------------------------- - ldr r0,=( PAGE_128M | 0x08000000 | 1) - mcr p15, 0, r0, c6, c3, 0 - - @------------------------------------------------------------------------- - @ Region 4 - DTCM - @------------------------------------------------------------------------- - @ldr r0,=( PAGE_16K | 0x027C0000 | 1) - ldr r0,=( PAGE_16K | 0x00800000 | 1) - mcr p15, 0, r0, c6, c4, 0 - - @------------------------------------------------------------------------- - @ Region 5 - ITCM - @------------------------------------------------------------------------- - ldr r0,=( PAGE_32K | 0x00000000 | 1) - mcr p15, 0, r0, c6, c5, 0 - - @------------------------------------------------------------------------- - @ Region 6 - System ROM - @------------------------------------------------------------------------- - ldr r0,=( PAGE_32K | 0xFFFF0000 | 1) - mcr p15, 0, r0, c6, c6, 0 - - @------------------------------------------------------------------------- - @ Region 7 - IPC - @------------------------------------------------------------------------- - ldr r0,=( PAGE_4K | 0x027FF000 | 1) - mcr p15, 0, r0, c6, c7, 0 - - @------------------------------------------------------------------------- - @ Write buffer enable - @------------------------------------------------------------------------- - ldr r0,=0b00000110 - mcr p15, 0, r0, c3, c0, 0 - - @------------------------------------------------------------------------- - @ DCache & ICache enable - @------------------------------------------------------------------------- - ldr r0,=0b01000110 - ldr r0,=0x42 - mcr p15, 0, r0, c2, c0, 0 - mcr p15, 0, r0, c2, c0, 1 - - @------------------------------------------------------------------------- - @ IAccess - @------------------------------------------------------------------------- - ldr r0,=0x06606333 - mcr p15, 0, r0, c5, c0, 3 - - @------------------------------------------------------------------------- - @ DAccess - @------------------------------------------------------------------------- - ldr r0,=0x36033333 - mcr p15, 0, r0, c5, c0, 2 - - @------------------------------------------------------------------------- - @ Enable ICache, DCache, ITCM & DTCM - @------------------------------------------------------------------------- - mrc p15, 0, r0, c1, c0, 0 - ldr r1,=0x55005 - orr r0,r0,r1 - mcr p15, 0, r0, c1, c0, 0 - - mov r0, #0x12 @ Switch to IRQ Mode - msr cpsr, r0 - ldr sp, =__sp_irq @ Set IRQ stack - - mov r0, #0x13 @ Switch to SVC Mode - msr cpsr, r0 - ldr sp, =__sp_svc @ Set SVC stack - - mov r0, #0x1F @ Switch to System Mode - msr cpsr, r0 - ldr sp, =__sp_usr @ Set user stack - - ldr r1, =__data_lma @ Copy initialized data (data section) from LMA to VMA (ROM to RAM) - ldr r2, =__data_start - ldr r4, =__data_end - bl CopyMemCheck - - ldr r1, =__iwram_lma @ Copy internal work ram (iwram section) from LMA to VMA (ROM to RAM) - ldr r2, =__iwram_start - ldr r4, =__iwram_end - bl CopyMemCheck - - ldr r1, =__itcm_lma @ Copy instruction tightly coupled memory (itcm section) from LMA to VMA (ROM to RAM) - ldr r2, =__itcm_start - ldr r4, =__itcm_end - bl CopyMemCheck - - ldr r1, =__dtcm_lma @ Copy data tightly coupled memory (dtcm section) from LMA to VMA (ROM to RAM) - ldr r2, =__dtcm_start - ldr r4, =__dtcm_end - bl CopyMemCheck - - ldr r0, =__bss_start @ Clear BSS section - ldr r1, =__bss_end - sub r1, r1, r0 - bl ClearMem - - ldr r0, =__sbss_start @ Clear SBSS section - ldr r1, =__sbss_end - sub r1, r1, r0 - bl ClearMem - - ldr r1, =fake_heap_end @ set heap end - ldr r0, =__eheap_end - str r0, [r1] - - ldr r3, =_init @ global constructors - bl _call_via_r3 - - mov r0, #0 @ int argc - mov r1, #0 @ char *argv[] - ldr r3, =main - bl _call_via_r3 @ jump to user code - - @ If the user ever returns, go to an infinte loop - ldr r0, =ILoop - ldr r0, [r0] - ldr r1, =0x027FFE78 - str r0, [r1] - bx r1 -ILoop: - b ILoop - -@--------------------------------------------------------------------------------- -@ Clear memory to 0x00 if length != 0 -@ r0 = Start Address -@ r1 = Length -@--------------------------------------------------------------------------------- -ClearMem: -@--------------------------------------------------------------------------------- - mov r2, #3 @ Round down to nearest word boundary - add r1, r1, r2 @ Shouldn't be needed - bics r1, r1, r2 @ Clear 2 LSB (and set Z) - bxeq lr @ Quit if copy size is 0 - - mov r2, #0 -ClrLoop: - stmia r0!, {r2} - subs r1, r1, #4 - bne ClrLoop - - bx lr - -@--------------------------------------------------------------------------------- -@ Copy memory if length != 0 -@ r1 = Source Address -@ r2 = Dest Address -@ r4 = Dest Address + Length -@--------------------------------------------------------------------------------- -CopyMemCheck: -@--------------------------------------------------------------------------------- - sub r3, r4, r2 @ Is there any data to copy? -@--------------------------------------------------------------------------------- -@ Copy memory -@ r1 = Source Address -@ r2 = Dest Address -@ r3 = Length -@--------------------------------------------------------------------------------- -CopyMem: -@--------------------------------------------------------------------------------- - mov r0, #3 @ These commands are used in cases where - add r3, r3, r0 @ the length is not a multiple of 4, - bics r3, r3, r0 @ even though it should be. - bxeq lr @ Length is zero, so exit -CIDLoop: - ldmia r1!, {r0} - stmia r2!, {r0} - subs r3, r3, #4 - bne CIDLoop - - bx lr -@--------------------------------------------------------------------------------- - .align - .pool - .end -@--------------------------------------------------------------------------------- diff --git a/dka-crtls/ds_cart.ld b/dka-crtls/ds_cart.ld deleted file mode 100644 index 98cbee2..0000000 --- a/dka-crtls/ds_cart.ld +++ /dev/null @@ -1,197 +0,0 @@ -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) - -MEMORY { - - rom : ORIGIN = 0x08000000, LENGTH = 32M - iwram : ORIGIN = 0x03800000, LENGTH = 64K - ewram : ORIGIN = 0x02000000, LENGTH = 4M -} -__iwram_start = 0x03800000; - -__ewram_start = 0x02000000; -__eheap_end = 0x02040000; -__sp_irq = 0x03810000 - 0x60; -__sp_svc = __sp_irq - 0x100; -__sp_usr = __sp_svc - 0x100; - -SECTIONS -{ - .init : - { - __text_start = . ; - KEEP (*(.init)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0xff - .plt : { *(.plt) } >rom = 0xff - - .text : /* ALIGN (4): */ - { - - *(EXCLUDE_FILE (*text.iwram*) .text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - *(.glue_7) - *(.glue_7t) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0xff - - .fini : - { - KEEP (*(.fini)) - } >rom =0xff - - __text_end = . ; - - .rodata : - { - *(.rodata) - *all.rodata*(*) - *(.roda) - *(.rodata.*) - *(.gnu.linkonce.r*) - SORT(CONSTRUCTORS) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0xff - - .ctors : - { - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0xff - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0xff - - .eh_frame : - { - KEEP (*(.eh_frame)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0xff - - .gcc_except_table : - { - *(.gcc_except_table) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0xff - .jcr : { KEEP (*(.jcr)) } >rom = 0 - .got : { *(.got.plt) *(.got) } >rom = 0 - - __ewram_lma = . ; - - .ewram __ewram_start : AT (__ewram_lma) - { - __ewram_start = ABSOLUTE(.) ; - *(.ewram) - *ewram.*(.text) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - .sbss ALIGN(4): - { - __sbss_start = ABSOLUTE(.); - *(.sbss) - . = ALIGN(4); - } >ewram - __sbss_end = . ; - - _end = . ; - __end__ = . ; - PROVIDE (end = _end); - - __iwram_lma = __ewram_lma + SIZEOF(.ewram) + SIZEOF(.sbss); - - .iwram __iwram_start : AT (__iwram_lma) - { - __iwram_start = ABSOLUTE(.) ; - *(.iwram) - *iwram.*(.text) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - __iwram_end = . ; - __data_lma = __iwram_lma + SIZEOF(.iwram) ; - - - .data ALIGN(4) : AT (__data_lma) - { - __data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - CONSTRUCTORS - . = ALIGN(4); - } >iwram = 0xff - - __data_end = . ; - __appended_data = __data_lma + SIZEOF(.data) ; - - - .bss ALIGN(4) : - { - __bss_start = ABSOLUTE(.); - __bss_start__ = ABSOLUTE(.); - *(.dynbss) - *(.gnu.linkonce.b*) - *(COMMON) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram - - __bss_end = . ; - __bss_end__ = . ; - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .stack 0x80000 : { _stack = .; *(.stack) } - /* These must appear regardless of . */ -} diff --git a/dka-crtls/ds_cart.specs b/dka-crtls/ds_cart.specs deleted file mode 100644 index f3a6ff4..0000000 --- a/dka-crtls/ds_cart.specs +++ /dev/null @@ -1,8 +0,0 @@ -%rename link old_link - -*link: -%(old_link) -T ds_cart.ld%s - -*startfile: -ds_cart_crt0%O%s crti%O%s crtbegin%O%s - diff --git a/dka-crtls/ds_cart_crt0.s b/dka-crtls/ds_cart_crt0.s deleted file mode 100644 index fa9997a..0000000 --- a/dka-crtls/ds_cart_crt0.s +++ /dev/null @@ -1,161 +0,0 @@ -@--------------------------------------------------------------------------------- - .section ".init" - .global _start - .arm -@--------------------------------------------------------------------------------- -_start: -@--------------------------------------------------------------------------------- - b rom_header_end - -@--------------------------------------------------------------------------------- - .fill 156,1,0 @ Nintendo Logo Character Data (8000004h) - .fill 16,1,0 @ Game Title - .byte 0x30,0x31 @ Maker Code (80000B0h) - .byte 0x96 @ Fixed Value (80000B2h) - .byte 0x00 @ Main Unit Code (80000B3h) - .byte 0x00 @ Device Type (80000B4h) - .fill 7,1,0 @ unused - .byte 0x00 @ Software Version No (80000BCh) - .byte 0xf0 @ Complement Check (80000BDh) - .byte 0x00,0x00 @ Checksum (80000BEh) - -rom_header_end: - b start_vector @ This branch must be here for proper - @ positioning of the following header. - - .GLOBAL __boot_method, __slave_number -__boot_method: - .byte 0 @ boot method (0=ROM boot, 3=Multiplay boot) -__slave_number: - .byte 0 @ slave # (1=slave#1, 2=slave#2, 3=slave#3) - - .byte 0 @ reserved - .byte 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved -@--------------------------------------------------------------------------------- - .align 4 - .arm -@--------------------------------------------------------------------------------- -start_vector: -@--------------------------------------------------------------------------------- - mov r0, #0x04000000 @ IME = 0; - add r0, r0, #0x208 - strh r0, [r0] - - mov r0, #0x12 @ Switch to IRQ Mode - msr cpsr, r0 - ldr sp, =__sp_irq @ Set IRQ stack - - mov r0, #0x13 @ Switch to SVC Mode - msr cpsr, r0 - ldr sp, =__sp_svc @ Set SVC stack - - - mov r0, #0x1F @ Switch to System Mode - msr cpsr, r0 - ldr sp, =__sp_usr @ Set user stack - - mov r1, #0x42 - strb r1, [r7], #1 - mov r1, #0x35 - strb r1, [r7], #1 - mov r1, #0x2B - strb r1, [r7], #1 - mov r1, #0x2B - strb r1, [r7], #1 - - ldr r1, =__data_lma @ Copy initialized data (data section) from LMA to VMA (ROM to RAM) - ldr r2, =__data_start - ldr r4, =__data_end - bl CopyMemChk - - ldr r1, =__iwram_lma @ Copy internal work ram (iwram section) from LMA to VMA (ROM to RAM) - ldr r2, =__iwram_start - ldr r4, =__iwram_end - bl CopyMemChk - - ldr r0, =__bss_start @ Clear BSS section to 0x00 - ldr r1, =__bss_end - sub r1, r1, r0 - bl ClearMem - - ldr r0, =__sbss_start @ Clear SBSS section to 0x00 - ldr r1, =__sbss_end - sub r1, r1, r0 - bl ClearMem - - ldr r1, =fake_heap_end @ set heap end - ldr r0, =__eheap_end - str r0, [r1] - - ldr r3, =_init @ global constructors - bl _call_via_r3 - - mov r0, #0 @ int argc - mov r1, #0 @ char *argv[] - ldr r3, =main - bl _call_via_r3 @ jump to user code - - -@--------------------------------------------------------------------------------- -@ Clear memory to 0x00 if length != 0 -@ r0 = Start Address -@ r1 = Length -@--------------------------------------------------------------------------------- -ClearMem: - mov r2, #3 @ Round down to nearest word boundary - add r1, r1, r2 @ Shouldn't be needed - bics r1, r1, r2 @ Clear 2 LSB (and set Z) - bxeq lr @ Quit if copy size is 0 - - mov r2, #0 -@--------------------------------------------------------------------------------- -ClrLoop: -@--------------------------------------------------------------------------------- - stmia r0!, {r2} - subs r1, r1, #4 - bne ClrLoop - bx lr - -@--------------------------------------------------------------------------------- -@ Copy memory if length != 0 -@ r1 = Source Address -@ r2 = Dest Address -@ r4 = Dest Address + Length -@--------------------------------------------------------------------------------- -CopyMemChk: -@--------------------------------------------------------------------------------- - sub r3, r4, r2 @ Is there any data to copy? -@--------------------------------------------------------------------------------- -@ Copy memory -@ r1 = Source Address -@ r2 = Dest Address -@ r3 = Length -@--------------------------------------------------------------------------------- -CopyMem: -@--------------------------------------------------------------------------------- - mov r0, #3 @ These commands are used in cases where - add r3, r3, r0 @ the length is not a multiple of 4, - bics r3, r3, r0 @ even though it should be. - bxeq lr @ Length is zero so exit - -@--------------------------------------------------------------------------------- -CIDLoop: -@--------------------------------------------------------------------------------- - ldmia r1!, {r0} - stmia r2!, {r0} - subs r3, r3, #4 - bne CIDLoop - bx lr -@--------------------------------------------------------------------------------- - .align - .pool -@--------------------------------------------------------------------------------- - .end -@--------------------------------------------------------------------------------- - diff --git a/dka-crtls/er_crt0.s b/dka-crtls/er_crt0.s deleted file mode 100644 index 801ffa3..0000000 --- a/dka-crtls/er_crt0.s +++ /dev/null @@ -1,56 +0,0 @@ -@--------------------------------------------------------------------------------- -@ nintendo e-reader startup code -@--------------------------------------------------------------------------------- -@ author : tim schuerewegen -@ version : 1.0 -@--------------------------------------------------------------------------------- - .section ".init" - .global _start - .align - .arm -@--------------------------------------------------------------------------------- -_start: -@--------------------------------------------------------------------------------- - b start_vector - .long 0 - .long 0x02000000 - -start_vector: - @ enter thumb mode - adr r0, _start_thumb + 1 - bx r0 - - .thumb - -_start_thumb: - - @ save return address (rom) - mov r3, lr - - @ clear bss section - ldr r0, =__bss_start - ldr r1, =__bss_end - mov r2, #0 -_loop_bss_clear: - strb r2, [r0] - add r0, #1 - cmp r0, r1 - blt _loop_bss_clear - - @ set return address (rom) - mov lr, r3 - - @ jump to main - ldr r3, =main - bx r3 - - .align - - .pool - - .end - - .align - .pool - .end - diff --git a/dka-crtls/gba.specs b/dka-crtls/gba.specs deleted file mode 100644 index 8d99583..0000000 --- a/dka-crtls/gba.specs +++ /dev/null @@ -1,8 +0,0 @@ -%rename link old_link - -*link: -%(old_link) -T gba_cart.ld%s - -*startfile: -gba_crt0%O%s crti%O%s crtbegin%O%s - diff --git a/dka-crtls/gba_cart.ld b/dka-crtls/gba_cart.ld deleted file mode 100644 index e1e8926..0000000 --- a/dka-crtls/gba_cart.ld +++ /dev/null @@ -1,298 +0,0 @@ -/* Linker Script Original v1.3 by Jeff Frohwein */ -/* v1.0 - Original release */ -/* v1.1 - Added proper .data section support */ -/* v1.2 - Added support for c++ & iwram overlays */ -/* - Major contributions by Jason Wilkins. */ -/* v1.3 - .ewram section now can be used when */ -/* compiling for MULTIBOOT mode. This fixes */ -/* malloc() in DevKitAdvance which depends */ -/* on __eheap_start instead of end to define*/ -/* the starting location of heap space. */ -/* External global variable __gba_iwram_heap*/ -/* support added to allow labels end, _end, */ -/* & __end__ to point to end of iwram or */ -/* the end of ewram. */ -/* Additions by WinterMute */ -/* v1.4 - .sbss section added for unitialised */ -/* data in ewram */ -/* v1.5 - padding section added to stop EZF */ -/* stripping important data */ - -/* This file is released into the public domain */ -/* for commercial or non-commercial use with no */ -/* restrictions placed upon it. */ - -/* NOTE!!!: This linker script defines the RAM & */ -/* ROM start addresses. In order for it to work */ -/* properly, remove -Ttext and -Tbss linker */ -/* options from your makefile if they are */ -/* present. */ - -/* You can use the following to view section */ -/* addresses in your .elf file: */ -/* objdump -h file.elf */ -/* Please note that empty sections may incorrectly*/ -/* list the lma address as the vma address for */ -/* some versions of objdump. */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) -/* SEARCH_DIR(/bin/arm); */ - -/* The linker script function "var1 += var2;" sometimes */ -/* reports incorrect values in the *.map file but the */ -/* actual value it calculates is usually, if not always, */ -/* correct. If you leave out the ". = ALIGN(4);" at the */ -/* end of each section then the return value of SIZEOF() */ -/* is sometimes incorrect and "var1 += var2;" appears to */ -/* not work as well. "var1 += var2" style functions are */ -/* avoided below as a result. */ - -MEMORY { - - rom : ORIGIN = 0x08000000, LENGTH = 32M - iwram : ORIGIN = 0x03000000, LENGTH = 32K - ewram : ORIGIN = 0x02000000, LENGTH = 256K -} - -__text_start = 0x8000000; -__eheap_end = 0x2040000; -__iwram_start = 0x3000000; -__iwram_end = 0x3008000; - -__sp_irq = __iwram_end - 0x100; -__sp_usr = __sp_irq - 0x100; - -SECTIONS -{ - . = __text_start; - .init : - { - KEEP (*(.init)) - . = ALIGN(4); - } >rom =0xff - - .plt : - { - *(.plt) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom - - .text : /* ALIGN (4): */ - { - *(EXCLUDE_FILE (*.iwram*) .text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - *(.glue_7) - *(.glue_7t) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0xff - - __text_end = .; - .fini : - { - KEEP (*(.fini)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom =0 - - .rodata : - { - *(.rodata) - *all.rodata*(*) - *(.roda) - *(.rodata.*) - *(.gnu.linkonce.r*) - SORT(CONSTRUCTORS) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0xff - - .ctors : - { - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0 - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0 - - .jcr : { KEEP (*(.jcr)) } >rom - - .eh_frame : - { - KEEP (*(.eh_frame)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0 - - .gcc_except_table : - { - *(.gcc_except_table) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >rom = 0 - - __iwram_lma = .; - - .iwram __iwram_start : AT (__iwram_lma) - { - __iwram_start = ABSOLUTE(.) ; - *(.iwram) - *iwram.*(.text) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - __data_lma = __iwram_lma + SIZEOF(.iwram) ; - __iwram_end = . ; - - .bss ALIGN(4) : - { - __bss_start = ABSOLUTE(.); - __bss_start__ = ABSOLUTE(.); - *(.dynbss) - *(.gnu.linkonce.b*) - *(COMMON) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram - - __bss_end = . ; - __bss_end__ = . ; - - .data ALIGN(4) : AT (__data_lma) - { - __data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - CONSTRUCTORS - . = ALIGN(4); - } >iwram = 0xff - - __iwram_overlay_lma = __data_lma + SIZEOF(.data); - - __data_end = .; - __iwram_overlay_start = . ; - - OVERLAY ALIGN(4) : NOCROSSREFS AT (__iwram_overlay_lma) - { - .iwram0 { *(.iwram0) . = ALIGN(4);} - .iwram1 { *(.iwram1) . = ALIGN(4);} - .iwram2 { *(.iwram2) . = ALIGN(4);} - .iwram3 { *(.iwram3) . = ALIGN(4);} - .iwram4 { *(.iwram4) . = ALIGN(4);} - .iwram5 { *(.iwram5) . = ALIGN(4);} - .iwram6 { *(.iwram6) . = ALIGN(4);} - .iwram7 { *(.iwram7) . = ALIGN(4);} - .iwram8 { *(.iwram8) . = ALIGN(4);} - .iwram9 { *(.iwram9) . = ALIGN(4);} - }>iwram = 0xff - - __ewram_lma = LOADADDR(.iwram0) + SIZEOF(.iwram0)+SIZEOF(.iwram1)+SIZEOF(.iwram2)+SIZEOF(.iwram3)+SIZEOF(.iwram4)+SIZEOF(.iwram5)+SIZEOF(.iwram6)+SIZEOF(.iwram7)+SIZEOF(.iwram8)+SIZEOF(.iwram9); - - __iwram_overlay_end = . ; - __iheap_start = . ; - - __ewram_start = 0x2000000; - .ewram __ewram_start : AT (__ewram_lma) - { - *(.ewram) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - }>ewram = 0xff - - __ewram_overlay_lma = __ewram_lma + SIZEOF(.ewram); - - .sbss ALIGN(4): - { - __sbss_start = ABSOLUTE(.); - *(.sbss) - . = ALIGN(4); - } >ewram - - __sbss_end = .; - - __ewram_end = . ; - __ewram_overlay_start = . ; - - OVERLAY ALIGN(4): NOCROSSREFS AT (__ewram_overlay_lma) - { - .ewram0 { *(.ewram0) . = ALIGN(4);} - .ewram1 { *(.ewram1) . = ALIGN(4);} - .ewram2 { *(.ewram2) . = ALIGN(4);} - .ewram3 { *(.ewram3) . = ALIGN(4);} - .ewram4 { *(.ewram4) . = ALIGN(4);} - .ewram5 { *(.ewram5) . = ALIGN(4);} - .ewram6 { *(.ewram6) . = ALIGN(4);} - .ewram7 { *(.ewram7) . = ALIGN(4);} - .ewram8 { *(.ewram8) . = ALIGN(4);} - .ewram9 { *(.ewram9) . = ALIGN(4);} - }>ewram = 0xff - - __pad_lma = LOADADDR(.ewram0) + SIZEOF(.ewram0)+SIZEOF(.ewram1)+SIZEOF(.ewram2)+SIZEOF(.ewram3)+SIZEOF(.ewram4)+SIZEOF(.ewram5)+SIZEOF(.ewram6)+SIZEOF(.ewram7)+SIZEOF(.ewram8)+SIZEOF(.ewram9); - - /* EZF Advance strips trailing 0xff bytes, add a pad section so nothing important is removed */ - .pad ALIGN(4) : AT (__pad_lma) - { - LONG(0x52416b64) - LONG(0x4d) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } = 0xff - - __ewram_overlay_end = . ; - __eheap_start = . ; - - _end = .; - __end__ = _end ; /* v1.3 */ - PROVIDE (end = _end); /* v1.3 */ - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .stack 0x80000 : { _stack = .; *(.stack) } - /* These must appear regardless of . */ -} diff --git a/dka-crtls/gba_crt0.s b/dka-crtls/gba_crt0.s deleted file mode 100644 index 2849a41..0000000 --- a/dka-crtls/gba_crt0.s +++ /dev/null @@ -1,248 +0,0 @@ - .section ".init" - .global _start - .align - .arm -@--------------------------------------------------------------------------------- -_start: -@--------------------------------------------------------------------------------- - b rom_header_end - - .fill 156,1,0 @ Nintendo Logo Character Data (8000004h) - .fill 16,1,0 @ Game Title - .byte 0x30,0x31 @ Maker Code (80000B0h) - .byte 0x96 @ Fixed Value (80000B2h) - .byte 0x00 @ Main Unit Code (80000B3h) - .byte 0x00 @ Device Type (80000B4h) - .fill 7,1,0 @ unused - .byte 0x00 @ Software Version No (80000BCh) - .byte 0xf0 @ Complement Check (80000BDh) - .byte 0x00,0x00 @ Checksum (80000BEh) - -@--------------------------------------------------------------------------------- -rom_header_end: -@--------------------------------------------------------------------------------- - b start_vector @ This branch must be here for proper - @ positioning of the following header. - - .GLOBAL __boot_method, __slave_number -@--------------------------------------------------------------------------------- -__boot_method: -@--------------------------------------------------------------------------------- - .byte 0 @ boot method (0=ROM boot, 3=Multiplay boot) -@--------------------------------------------------------------------------------- -__slave_number: -@--------------------------------------------------------------------------------- - .byte 0 @ slave # (1=slave#1, 2=slave#2, 3=slave#3) - - .byte 0 @ reserved - .byte 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved - .word 0 @ reserved - - .global start_vector - .align -@--------------------------------------------------------------------------------- -start_vector: -@--------------------------------------------------------------------------------- - mov r0, #0x4000000 @ REG_BASE - add r0, r0, #0x208 @ REG_IME - strh r0, [r0] - - mov r0, #0x12 @ Switch to IRQ Mode - msr cpsr, r0 - ldr sp, =__sp_irq @ Set IRQ stack - mov r0, #0x1f @ Switch to System Mode - msr cpsr, r0 - ldr sp, =__sp_usr @ Set user stack - -@--------------------------------------------------------------------------------- -@ Enter Thumb mode -@--------------------------------------------------------------------------------- - add r0, pc, #1 - bx r0 - - .thumb - - ldr r0, =__text_start - lsl r0, #5 @ Was code compiled at 0x08000000 or higher? - bcs DoEWRAMClear @ yes, you can not run it in external WRAM - - mov r0, pc - lsl r0, #5 @ Are we running from ROM (0x8000000 or higher) ? - bcc SkipEWRAMClear @ No, so no need to do a copy. - -@--------------------------------------------------------------------------------- -@ We were started in ROM, silly emulators. :P -@ So we need to copy to ExWRAM. -@--------------------------------------------------------------------------------- - mov r3, #0x40 - lsl r3, #12 @ r3 = 0x40000 - lsl r2, r3, #7 @ r2 = 0x2000000 - mov r6, r2 @ r6 = 0x2000000 - lsl r1, r2, #2 @ r1 = 0x8000000 - - bl CopyMem - - bx r6 @ Jump to the code to execute - -@--------------------------------------------------------------------------------- -DoEWRAMClear: @ Clear External WRAM to 0x00 -@--------------------------------------------------------------------------------- - mov r1, #0x40 - lsl r1, #12 @ r1 = 0x40000 - lsl r0, r1, #7 @ r0 = 0x2000000 - bl ClearMem - -@--------------------------------------------------------------------------------- -SkipEWRAMClear: @ Clear Internal WRAM to 0x00 -@--------------------------------------------------------------------------------- - mov r0, #3 - lsl r0, #24 @ r0 = 0x3000000 - ldr r1, =__iwram_end - sub r1,r0 - bl ClearMem - -@--------------------------------------------------------------------------------- -@ Clear SBSS section to 0x00 -@--------------------------------------------------------------------------------- - ldr r0, =__sbss_start - ldr r1, =__sbss_end - sub r1, r0 - bl ClearMem - -@--------------------------------------------------------------------------------- -@ Copy initialized data (data section) from LMA to VMA (ROM to RAM) -@--------------------------------------------------------------------------------- - ldr r1, =__data_lma - ldr r2, =__data_start - ldr r4, =__data_end - bl CopyMemChk - -@--------------------------------------------------------------------------------- -@ Copy internal work ram (iwram section) from LMA to VMA (ROM to RAM) -@--------------------------------------------------------------------------------- - ldr r1,= __iwram_lma - ldr r2,= __iwram_start - ldr r4,= __iwram_end - bl CopyMemChk - -@--------------------------------------------------------------------------------- -@ Copy internal work ram overlay 0 (iwram0 section) from LMA to VMA (ROM to RAM) -@--------------------------------------------------------------------------------- - ldr r2,= __load_stop_iwram0 - ldr r1,= __load_start_iwram0 - sub r3, r2, r1 @ Is there any data to copy? - beq CIW0Skip @ no - - ldr r2,= __iwram_overlay_start - bl CopyMem -@--------------------------------------------------------------------------------- -CIW0Skip: -@--------------------------------------------------------------------------------- -@ Copy external work ram (ewram section) from LMA to VMA (ROM to RAM) -@--------------------------------------------------------------------------------- - ldr r1, =__ewram_lma - ldr r2, =__ewram_start - ldr r4, =__ewram_end - bl CopyMemChk - -@--------------------------------------------------------------------------------- -@ Copy external work ram overlay 0 (ewram0 section) from LMA to VMA (ROM to RAM) -@--------------------------------------------------------------------------------- - ldr r2, =__load_stop_ewram0 - ldr r1, =__load_start_ewram0 - sub r3, r2, r1 @ Is there any data to copy? - beq CEW0Skip @ no - - ldr r2, =__ewram_overlay_start - bl CopyMem -@--------------------------------------------------------------------------------- -CEW0Skip: -@--------------------------------------------------------------------------------- -@ set heap end -@--------------------------------------------------------------------------------- - ldr r1, =fake_heap_end - ldr r0, =__eheap_end - str r0, [r1] -@--------------------------------------------------------------------------------- -@ global constructors -@--------------------------------------------------------------------------------- - ldr r3, =_init - bl _call_via_r3 -@--------------------------------------------------------------------------------- -@ Jump to user code -@--------------------------------------------------------------------------------- - mov r0, #0 @ int argc - mov r1, #0 @ char *argv[] - ldr r3, =main - bl _call_via_r3 -@--------------------------------------------------------------------------------- -@ Clear memory to 0x00 if length != 0 -@--------------------------------------------------------------------------------- -@ r0 = Start Address -@ r1 = Length -@--------------------------------------------------------------------------------- -ClearMem: -@--------------------------------------------------------------------------------- - mov r2,#3 @ These commands are used in cases where - add r1,r2 @ the length is not a multiple of 4, - bic r1,r2 @ even though it should be. - - beq ClearMX @ Length is zero so exit - - mov r2,#0 -@--------------------------------------------------------------------------------- -ClrLoop: -@--------------------------------------------------------------------------------- - stmia r0!, {r2} - sub r1,#4 - bne ClrLoop -@--------------------------------------------------------------------------------- -ClearMX: -@--------------------------------------------------------------------------------- - bx lr - -@--------------------------------------------------------------------------------- -@ Copy memory if length != 0 -@--------------------------------------------------------------------------------- -@ r1 = Source Address -@ r2 = Dest Address -@ r4 = Dest Address + Length -@--------------------------------------------------------------------------------- -CopyMemChk: -@--------------------------------------------------------------------------------- - sub r3, r4, r2 @ Is there any data to copy? -@--------------------------------------------------------------------------------- -@ Copy memory -@--------------------------------------------------------------------------------- -@ r1 = Source Address -@ r2 = Dest Address -@ r3 = Length -@--------------------------------------------------------------------------------- -CopyMem: -@--------------------------------------------------------------------------------- - mov r0, #3 @ These commands are used in cases where - add r3, r0 @ the length is not a multiple of 4, - bic r3, r0 @ even though it should be. - beq CIDExit @ Length is zero so exit - -@--------------------------------------------------------------------------------- -CIDLoop: -@--------------------------------------------------------------------------------- - ldmia r1!, {r0} - stmia r2!, {r0} - sub r3, #4 - bne CIDLoop -@--------------------------------------------------------------------------------- -CIDExit: -@--------------------------------------------------------------------------------- - bx lr - - .align - .pool - .end - diff --git a/dka-crtls/gba_er.ld b/dka-crtls/gba_er.ld deleted file mode 100644 index 4147ebe..0000000 --- a/dka-crtls/gba_er.ld +++ /dev/null @@ -1,50 +0,0 @@ -/***********************************/ -/* NINTENDO E-READER LINKER SCRIPT */ -/***********************************/ -/* Author : Tim Schuerewegen */ -/* Version : 1.0 */ -/***********************************/ - -OUTPUT_FORMAT( "elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH( arm) -ENTRY( _start) - -SECTIONS -{ - . = 0x02000000; - - .init : - { - *(.init) - . = ALIGN(4); - } = 0xff - - .text : - { - *(.text) - . = ALIGN(4); - } = 0xff - - .rodata : - { - *(.rodata) - . = ALIGN(4); - } = 0xff - - .data : - { - *(.data) - . = ALIGN(4); - } = 0xff - - .bss : - { - __bss_start = .; - *(.bss) - . = ALIGN(4); - } - __bss_end = .; - - __end = .; -} - diff --git a/dka-crtls/gba_er.specs b/dka-crtls/gba_er.specs deleted file mode 100644 index 419b085..0000000 --- a/dka-crtls/gba_er.specs +++ /dev/null @@ -1,8 +0,0 @@ -%rename link old_link -%rename endfile old_endfile - -*link: --T gba_er.ld%s %(old_link) - -*startfile: -er_crt0%O%s diff --git a/dka-crtls/gba_mb.ld b/dka-crtls/gba_mb.ld deleted file mode 100644 index 8159bc0..0000000 --- a/dka-crtls/gba_mb.ld +++ /dev/null @@ -1,284 +0,0 @@ -/* Linker Script Original v1.3 by Jeff Frohwein */ -/* v1.0 - Original release */ -/* v1.1 - Added proper .data section support */ -/* v1.2 - Added support for c++ & iwram overlays */ -/* - Major contributions by Jason Wilkins. */ -/* v1.3 - .ewram section now can be used when */ -/* compiling for MULTIBOOT mode. This fixes */ -/* malloc() in DevKitAdvance which depends */ -/* on __eheap_start instead of end to define*/ -/* the starting location of heap space. */ -/* External global variable __gba_iwram_heap*/ -/* support added to allow labels end, _end, */ -/* & __end__ to point to end of iwram or */ -/* the end of ewram. */ -/* Additions by WinterMute */ -/* v1.4 - .sbss section added for unitialised */ -/* data in ewram */ -/* v1.5 - padding section added to stop EZF */ -/* stripping important data */ -/* v1.6 - added memory sections */ - -/* This file is released into the public domain */ -/* for commercial or non-commercial use with no */ -/* restrictions placed upon it. */ - -/* NOTE!!!: This linker script defines the RAM & */ -/* ROM start addresses. In order for it to work */ -/* properly, remove -Ttext and -Tbss linker */ -/* options from your makefile if they are */ -/* present. */ - -/* You can use the following to view section */ -/* addresses in your .elf file: */ -/* objdump -h file.elf */ -/* Please note that empty sections may incorrectly*/ -/* list the lma address as the vma address for */ -/* some versions of objdump. */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) - -MEMORY { - - rom : ORIGIN = 0x08000000, LENGTH = 32M - iwram : ORIGIN = 0x03000000, LENGTH = 32K - ewram : ORIGIN = 0x02000000, LENGTH = 256K -} - - - -__text_start = 0x2000000 ; -__eheap_end = 0x2040000; -__iwram_start = 0x3000000; -__iwram_end = 0x3008000; -__sp_irq = __iwram_end - 0x100; -__sp_usr = __sp_irq - 0x100; - -SECTIONS -{ - . = __text_start; - .init : - { - KEEP (*(.init)) - . = ALIGN(4); - } >ewram =0xff - - .plt : - { - *(.plt) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram - - .text ALIGN (4): - { - *(EXCLUDE_FILE (*.iwram*) .text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - *(.glue_7) - *(.glue_7t) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - __text_end = .; - .fini : - { - KEEP (*(.fini)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram =0 - - .rodata : - { - *(.rodata) - *all.rodata*(*) - *(.roda) - *(.rodata.*) - *(.gnu.linkonce.r*) - SORT(CONSTRUCTORS) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - .ctors : - { - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0 - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0 - - .jcr : { KEEP (*(.jcr)) } >ewram - .eh_frame : - { - KEEP (*(.eh_frame)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0 - - .gcc_except_table : - { - *(.gcc_except_table) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0 - - __iwram_lma = .; - - .iwram __iwram_start : AT (__iwram_lma) - { - __iwram_start = ABSOLUTE(.) ; - *(.iwram) - *iwram.*(.text) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - __data_lma = __iwram_lma + SIZEOF(.iwram) ; - __iwram_end = . ; - - .bss ALIGN(4) : - { - __bss_start = ABSOLUTE(.); - __bss_start__ = ABSOLUTE(.); - *(.dynbss) - *(.gnu.linkonce.b*) - *(COMMON) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } - - __bss_end = . ; - __bss_end__ = . ; - - .data ALIGN(4) : AT (__data_lma) - { - __data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - CONSTRUCTORS - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >iwram = 0xff - - __iwram_overlay_lma = __data_lma + SIZEOF(.data); - - __data_end = .; - PROVIDE (edata = .); - __iwram_overlay_start = . ; - - OVERLAY ALIGN(4) : NOCROSSREFS AT (__iwram_overlay_lma) - { - .iwram0 { *(.iwram0) . = ALIGN(4);} - .iwram1 { *(.iwram1) . = ALIGN(4);} - .iwram2 { *(.iwram2) . = ALIGN(4);} - .iwram3 { *(.iwram3) . = ALIGN(4);} - .iwram4 { *(.iwram4) . = ALIGN(4);} - .iwram5 { *(.iwram5) . = ALIGN(4);} - .iwram6 { *(.iwram6) . = ALIGN(4);} - .iwram7 { *(.iwram7) . = ALIGN(4);} - .iwram8 { *(.iwram8) . = ALIGN(4);} - .iwram9 { *(.iwram9) . = ALIGN(4);} - } >iwram = 0xff - - __ewram_lma = LOADADDR(.iwram0) + SIZEOF(.iwram0)+SIZEOF(.iwram1)+SIZEOF(.iwram2)+SIZEOF(.iwram3)+SIZEOF(.iwram4)+SIZEOF(.iwram5)+SIZEOF(.iwram6)+SIZEOF(.iwram7)+SIZEOF(.iwram8)+SIZEOF(.iwram9); - - __iwram_overlay_end = . ; - __iheap_start = . ; - - /* v1.3 */ - __ewram_start = __ewram_lma ; - - .ewram __ewram_start : AT (__ewram_lma) - { - *(.ewram) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ewram = 0xff - - __ewram_overlay_lma = __ewram_lma + SIZEOF(.ewram); - - .sbss ALIGN(4): - { - __sbss_start = ABSOLUTE(.); - *(.sbss) - . = ALIGN(4); - } - - __sbss_end = .; - - __ewram_end = . ; - __ewram_overlay_start = . ; - - OVERLAY ALIGN(4): NOCROSSREFS AT (__ewram_overlay_lma) - { - .ewram0 { *(.ewram0) . = ALIGN(4);} - .ewram1 { *(.ewram1) . = ALIGN(4);} - .ewram2 { *(.ewram2) . = ALIGN(4);} - .ewram3 { *(.ewram3) . = ALIGN(4);} - .ewram4 { *(.ewram4) . = ALIGN(4);} - .ewram5 { *(.ewram5) . = ALIGN(4);} - .ewram6 { *(.ewram6) . = ALIGN(4);} - .ewram7 { *(.ewram7) . = ALIGN(4);} - .ewram8 { *(.ewram8) . = ALIGN(4);} - .ewram9 { *(.ewram9) . = ALIGN(4);} - } >ewram = 0xff - - __ewram_overlay_end = . ; - - __eheap_start = . ; - - _end = .; - __end__ = _end ; /* v1.3 */ - PROVIDE (end = _end); /* v1.3 */ - - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .stack 0x80000 : { _stack = .; *(.stack) } - /* These must appear regardless of . */ -} diff --git a/dka-crtls/gba_mb.specs b/dka-crtls/gba_mb.specs deleted file mode 100644 index cda74a5..0000000 --- a/dka-crtls/gba_mb.specs +++ /dev/null @@ -1,8 +0,0 @@ -%rename link old_link - -*link: --T gba_mb.ld%s %(old_link) - -*startfile: -gba_crt0%O%s crti%O%s crtbegin%O%s - diff --git a/dka-crtls/gp32.ld b/dka-crtls/gp32.ld deleted file mode 100644 index d044730..0000000 --- a/dka-crtls/gp32.ld +++ /dev/null @@ -1,152 +0,0 @@ -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) - -MEMORY - { - ram : ORIGIN = 0xc000000, LENGTH = 8M - } - -SECTIONS -{ - .init : - { - __text_start = . ; - KEEP (*(.init)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0xff - .plt : { *(.plt) } >ram = 0xff - - .text : /* ALIGN (4): */ - { - - *(EXCLUDE_FILE (*text.iwram*) .text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - *(.glue_7) - *(.glue_7t) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0xff - .fini : - { - KEEP (*(.fini)) - } >ram =0xff - - __text_end = . ; - - .rodata : - { - *(.rodata) - *all.rodata*(*) - *(.roda) - *(.rodata.*) - *(.gnu.linkonce.r*) - SORT(CONSTRUCTORS) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0xff - - .ctors : - { - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0 - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0 - - .eh_frame : - { - KEEP (*(.eh_frame)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0 - - .gcc_except_table : - { - *(.gcc_except_table) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0 - .jcr : { KEEP (*(.jcr)) } >ram = 0 - .got : { *(.got.plt) *(.got) } >ram = 0 - __ro_end = . ; - - .data ALIGN(4) : - { - __data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - CONSTRUCTORS - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0xff - - __data_end = . ; - - .bss ALIGN(4) : - { - __bss_start = ABSOLUTE(.); - /* __bss_start__ = ABSOLUTE(.); */ - *(.dynbss) - *(.gnu.linkonce.b*) - *(COMMON) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } > ram - __bss_end = . ; - - _end = . ; - __end__ = . ; - PROVIDE (end = _end); - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .stack 0x80000 : { _stack = .; *(.stack) } - /* These must appear regardless of . */ -} diff --git a/dka-crtls/gp32.specs b/dka-crtls/gp32.specs deleted file mode 100644 index a15e5b0..0000000 --- a/dka-crtls/gp32.specs +++ /dev/null @@ -1,8 +0,0 @@ -%rename link old_link - -*link: -%(old_link) -T gp32.ld%s - -*startfile: -gp32_crt0%O%s crti%O%s crtbegin%O%s - diff --git a/dka-crtls/gp32_crt0.s b/dka-crtls/gp32_crt0.s deleted file mode 100644 index 838dfc2..0000000 --- a/dka-crtls/gp32_crt0.s +++ /dev/null @@ -1,74 +0,0 @@ - .section ".init" - .code 32 - .align - .global _start -@--------------------------------------------------------------------------------- -_start: -@--------------------------------------------------------------------------------- - b _start2 - -@--------------------------------------------------------------------------------- -@ AXF addresses -@--------------------------------------------------------------------------------- -_text_start: - .word __text_start -_ro_end: - .word __ro_end -_data_start: - .word __data_start - .word __bss_end -_bss_start: - .word __bss_start -_bss_end: - .word __bss_end - -@--------------------------------------------------------------------------------- -@ GamePark magic sequence -@--------------------------------------------------------------------------------- - .word 0x44450011 - .word 0x44450011 - .word 0x01234567 - .word 0x12345678 - .word 0x23456789 - .word 0x34567890 - .word 0x45678901 - .word 0x56789012 - .word 0x23456789 - .word 0x34567890 - .word 0x45678901 - .word 0x56789012 - .word 0x23456789 - .word 0x34567890 - .word 0x45678901 - .word 0x56789012 - -@--------------------------------------------------------------------------------- -_start2: -@--------------------------------------------------------------------------------- - mrs r0, CPSR - orr r0, r0, #0xC0 - msr CPSR_ctl, r0 - - mrs r0, CPSR - bic r0, r0, #0xC0 - orr r0, r0, #0x40 - msr CPSR_ctl,r0 - -@--------------------------------------------------------------------------------- -@ global constructors -@--------------------------------------------------------------------------------- - ldr r3,=_call_main - mov lr,r3 - ldr r3,=_init - bx r3 -@--------------------------------------------------------------------------------- -@ Jump to user code -@--------------------------------------------------------------------------------- -_call_main: -@--------------------------------------------------------------------------------- - mov lr, #0 - ldr r3, =main - bx r3 - - .pool - .end diff --git a/dka-crtls/gp32_gpsdk.ld b/dka-crtls/gp32_gpsdk.ld deleted file mode 100644 index 4e2ed55..0000000 --- a/dka-crtls/gp32_gpsdk.ld +++ /dev/null @@ -1,197 +0,0 @@ -/* GP32 Linker Script v1.2 by Jeff F */ -/* v1.0 - Original release */ -/* v1.1 - Cleaned up and added MEMORY command */ -/* v1.2 - DJWillis - Added propper .init and */ -/* .fini for GCC 3.3.2 and above */ -/* */ -/* This file is released into the public domain */ -/* for commercial or non-commercial use with no */ -/* restrictions placed upon it. */ -/* */ -/* NOTE!!!: This linker script defines the RAM */ -/* start addresses. In order for it to work */ -/* properly, remove -Ttext and -Tbss linker */ -/* options from your makefile if they are */ -/* present. */ -/* */ -/* You can use the following to view section */ -/* addresses in your .elf file: */ -/* objdump -h file.elf */ -/* */ -/* Please note that empty sections may incorrectly*/ -/* list the lma address as the vma address for */ -/* some versions of objdump. */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) -/* SEARCH_DIR(/bin/arm); */ - -/* Then use it like this: IWRAMHEAP */ -/* The linker script function "var1 += var2;" sometimes */ -/* reports incorrect values in the *.map file but the */ -/* actual value it calculates is usually, if not always, */ -/* correct. If you leave out the ". = ALIGN(4);" at the */ -/* end of each section then the return value of SIZEOF() */ -/* is sometimes incorrect and "var1 += var2;" appears to */ -/* not work as well. "var1 += var2" style functions are */ -/* avoided below as a result. */ - -/* The linker script MEMORY directive is not used here due */ -/* to the fact that __text_start is not always a fixed value. */ - -MEMORY - { - ram : ORIGIN = 0xc000000, LENGTH = 8M - } - -SECTIONS -{ - .text : /* ALIGN (4): */ - { - __text_start = . ; - - *(EXCLUDE_FILE (*text.iwram*) .text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - *(.glue_7) - *(.glue_7t) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0xff - - __text_end = . ; - - - .init : - { - *(.init) - } > ram = 0xff - - .jcr : - { - *(.jcr) - } > ram = 0xff - - .fini : - { - *(.fini) - } > ram = 0xff - - .rodata : - { - *(.rodata) - *all.rodata*(*) - *(.roda) - *(.rodata.*) - *(.gnu.linkonce.r*) - SORT(CONSTRUCTORS) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0xff - - .ctors : - { - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0 - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0 - - .eh_frame : - { - KEEP (*(.eh_frame)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0 - - .gcc_except_table : - { - *(.gcc_except_table) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0 - __ro_end = . ; - - .data ALIGN(4) : - { - __data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - CONSTRUCTORS - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >ram = 0xff - - __data_end = . ; - - .bss ALIGN(4) : - { - __bss_start = ABSOLUTE(.); - /* __bss_start__ = ABSOLUTE(.); */ - *(.dynbss) - *(.gnu.linkonce.b*) - *(COMMON) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } > ram - __bss_end = . ; - - __eheap_start = . ; /* Needed by DevKitAdvance. Start of malloc() heap for DKA. */ - - _end = . ; - __end__ = . ; - PROVIDE (end = _end); - - __eheap_end = . ; - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .stack 0x80000 : { _stack = .; *(.stack) } - /* These must appear regardless of . */ -} diff --git a/dka-crtls/gp32_gpsdk.specs b/dka-crtls/gp32_gpsdk.specs deleted file mode 100644 index 014c55e..0000000 --- a/dka-crtls/gp32_gpsdk.specs +++ /dev/null @@ -1,8 +0,0 @@ -%rename link old_link - -*link: -%(old_link) -T gp32_gpsdk.ld%s - -*startfile: -gp32_gpsdk_crt0%O%s crti%O%s crtbegin%O%s - diff --git a/dka-crtls/gp32_gpsdk_crt0.s b/dka-crtls/gp32_gpsdk_crt0.s deleted file mode 100644 index 99770ce..0000000 --- a/dka-crtls/gp32_gpsdk_crt0.s +++ /dev/null @@ -1,246 +0,0 @@ -@**************************************************** -@* gp32 crt0.S v1.0 by Jeff F * -@**************************************************** - -@ v1.0 - Original release -@ -@ This file is released into the public domain for commercial -@ or non-commercial usage with no restrictions placed upon it. - - .TEXT - -@ Note: Normally it is the job of crt0.S to clear the BSS -@ (Zero Initialized) section to 0x00, but in the case of -@ the gp32 we do not have to do this because it is done -@ by the gp32 bios after it loads the app. - -@ The official sdt dev kit uses 'Main ()' as the entry -@ point. If you would rather use 'main ()' instead then -@ comment out the next line. -@ -@ You have to use 'main ()' at some point in your program -@ if you want to do c++ code. GCC will do a call to constructor -@ setup before executing 'main ()'. Using 'main ()' also increases -@ your program size by ~5500 bytes. - -@ .equ __OfficialEntry, 1 - -@ The official sdt dev kit initializes various things in init.o -@ Crt0.S performs similar tasks for compatibility. If you don't -@ wish to use the official libs, or those that are compatible, -@ then you need to comment out the next line to prevent link errors. - - .equ __OfficialInits, 1 - - - .GLOBAL _start -_start: - .ALIGN - .CODE 32 - - @ Start Vector - - b _GpInit - - .word __text_start @ Start of text (Read Only) section -_roe: .word __ro_end @ End " -_rws: .word __data_start @ Start of data (Read/Write) section - .word __bss_end @ End of bss (this is the way sdt does it for some reason) -_zis: .word __bss_start @ Start of bss (Zero Initialized) section -_zie: .word __bss_end @ End " - - .word 0x44450011 - .word 0x44450011 - - .word 0x01234567 - .word 0x12345678 - .word 0x23456789 - .word 0x34567890 - .word 0x45678901 - .word 0x56789012 - .word 0x23456789 - .word 0x34567890 - .word 0x45678901 - .word 0x56789012 - .word 0x23456789 - .word 0x34567890 - .word 0x45678901 - .word 0x56789012 - -_GpInit: - mrs r0,CPSR - orr r0,r0,#0xc0 - msr CPSR_fsxc,r0 - -.ifdef __OfficialInits - -@ Call function in user_init.s -@ bl asm_user_entry - -@ Get pointer to GpSurfaceSet routine - mov r0,#0 - swi 0xb - ldr r1,=GpSurfaceSet - ldr r2,=GpSurfaceFlip - str r0,[r1] - str r0,[r2] - -@ Get time passed - mov r0,#6 - swi 0xb - ldr r1,=_timepassed - str r0,[r1] - -@ Get button stuff - mov r0,#0 - swi 0x10 - ldr r2,=_reg_io_key_a - ldr r3,=_reg_io_key_b - str r0,[r2] - str r1,[r3] - -@ Set heap start location - ldr r0,_zie - ldr r1,=HEAPSTART - str r0,[r1] - -@ Set heap end location - mov r0,#5 - swi 0xb - ldr r1,=HEAPEND - sub r0,r0,#255 - bic r0,r0,#3 - str r0,[r1] - -@ Set App Argument - swi 0x15 - - mov r10,r0 - mov r11,r1 @ possibly not needed but left in anyway - - mrs r0,CPSR - bic r0,r0,#192 - orr r0,r0,#64 - msr CPSR_fsxc,r0 - - mov r0,r10 - mov r1,r11 @ possibly not needed but left in anyway -.endif - -@ Jump to Main () - -.ifdef __OfficialEntry - ldr r3,=Main -.else - ldr r3,=main -.endif - bx r3 @ Init.o uses 'mov pc,r3' but - @ 'bx r3' is used here instead. This way - @ the main function can be ARM or Thumb. - -.ifdef __OfficialInits - - swi 0x12 - orr r1,r1,r2 - and r1,r1,r3 - eor r1,r1,r4 - mov r5,r1,lsr #4 - add r1,r1,r7 - sub r7,r7,r1 - mov r8,#0 - mov pc,r8 - b . - b . - b . - b . - b . - b . - b . - b . - b . - b . - b . - b . - nop - nop - nop - nop - nop - nop - - .GLOBAL _fw_init_for_dbg -_fw_init_for_dbg: - stmdb sp!,{r0-r12} - - mov r10,lr - mov r11,sp - - bic r0,r0,#31 @ 0x1f - orr r1,r0,#17 @ 0x11 - orr r2,r0,#19 @ 0x13 - msr cpsr_cxsf,r1 - mov r12,#4 - add r12,r12,pc - msr cpsr_cxsf,r2 - swi 0x1ff - -@ bl asm_user_entry_path - - mov r0,r11 - mov r1,r10 - add r0,r0,#52 - ldr r2,[r0] - mov lr,r1 - stmdb sp!,{r2} - stmdb sp!,{r0-r12,lr} - -@ Copy RW Base - ZI Base - ldr r0,=_roe @ |Image$$RO$$Limit| - ldr r3,=_zis @ |Image$$ZI$$Base| - ldr r2,=_rws @ |Image$$RW$$Base| - sub r3,r3,r2 -CopyRWData: - cmp r3,#36 - blt CopyRWData2 - ldmia r0!,{r4-r12} - stmia r2!,{r4-r12} - sub r3,r3,#36 - b CopyRWData -CopyRWData2: - cmp r3,#0 - ble CopyRWData3 - ldr r4,[r0],#4 - str r4,[r2],#4 - sub r3,r3,#4 - b CopyRWData2 -CopyRWData3: - -@ Clear ZI section - ldr r1,=_zie @ |Image$$ZI$$Limit| - ldr r0,=_zis @ |Image$$ZI$$Base| - mov r2,#0 - mov r3,r2 - mov r4,r2 - mov r5,r2 - mov r6,r2 - mov r7,r2 - mov r8,r2 - mov r9,r2 - mov r10,r2 - mov r11,r2 - mov r12,r2 -CopyZIData: - stmia r0!,{r2-r12} - cmp r0,r1 - blt CopyZIData - - ldmia sp!,{r0-r12,pc} - -.endif - - .ALIGN - .POOL - - - .END - diff --git a/dka-rules/base_rules b/dka-rules/base_rules deleted file mode 100644 index 3b6b4a0..0000000 --- a/dka-rules/base_rules +++ /dev/null @@ -1,58 +0,0 @@ -#--------------------------------------------------------------------------------- -# path to tools - this can be deleted if you set the path in windows -#--------------------------------------------------------------------------------- -export PATH := $(DEVKITARM)/bin:$(PATH) - -#--------------------------------------------------------------------------------- -# the prefix on the compiler executables -#--------------------------------------------------------------------------------- -PREFIX := arm-elf- - -export CC := $(PREFIX)gcc -export CXX := $(PREFIX)g++ -export AR := $(PREFIX)ar -export OBJCOPY := $(PREFIX)objcopy - - -#--------------------------------------------------------------------------------- -%.a: -#--------------------------------------------------------------------------------- - @echo $(notdir $@) - @$(AR) -rc $@ $^ - -#--------------------------------------------------------------------------------- -%.o: %.cpp - @echo $(notdir $<) - @$(CXX) -MMD -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ - -#--------------------------------------------------------------------------------- -%.o: %.c - @echo $(notdir $<) - @$(CC) -MMD -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ - -#--------------------------------------------------------------------------------- -%.o: %.s - @echo $(notdir $<) - @$(CC) -MMD -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ - -#--------------------------------------------------------------------------------- -%.o: %.S - @echo $(notdir $<) - @$(CC) -MMD -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ - -#--------------------------------------------------------------------------------- -# canned command sequence for binary data -#--------------------------------------------------------------------------------- -define bin2o - padbin 4 $(<) - $(OBJCOPY) -I binary -O elf32-littlearm -B arm \ - --rename-section .data=.rodata,readonly,data,contents,alloc \ - --redefine-sym _binary_`(echo $(<) | sed -e 's/^\/\([a-zA-Z]\/\)/\1_/' | tr . _ | tr / _)`_start=`(echo $( `(echo $(> `(echo $(> `(echo $(&1 | tee $BUILDSCRIPTDIR/binutils_configure.log - - -$MAKE 2>&1 | tee binutils_make.log -$MAKE install 2>&1 | tee $BUILDSCRIPTDIR/binutils_install.log - -cd $BUILDSCRIPTDIR - -#--------------------------------------------------------------------------------- -# remove temp stuff to conserve disc space -#--------------------------------------------------------------------------------- -rm -fr $target/binutils -rm -fr $BINUTILS_SRCDIR - -#--------------------------------------------------------------------------------- -# build and install just the c compiler -#--------------------------------------------------------------------------------- -mkdir -p $target/gcc -cd $target/gcc - - -../../$GCC_SRCDIR/configure \ - --enable-languages=c,c++ \ - --with-cpu=arm7tdmi\ - --enable-interwork --enable-multilib\ - --with-gcc --with-gnu-ld --with-gnu-as --with-stabs \ - --disable-shared --disable-threads --disable-win32-registry --disable-nls\ - --target=$target \ - --with-newlib \ - --prefix=$prefix -v\ - 2>&1 | tee $BUILDSCRIPTDIR/gcc_configure.log - -$MAKE all-gcc 2>&1| tee $BUILDSCRIPTDIR/gcc_make.log -$MAKE install-gcc 2>&1 | tee $BUILDSCRIPTDIR/gcc_install.log - -cd $BUILDSCRIPTDIR - -#--------------------------------------------------------------------------------- -# build and install newlib -#--------------------------------------------------------------------------------- -mkdir -p $target/newlib -cd $target/newlib - -$BUILDSCRIPTDIR/$NEWLIB_SRCDIR/configure \ - --enable-serial-configure \ - --target=$target \ - --prefix=$prefix \ - --enable-newlib-mb \ - | tee $BUILDSCRIPTDIR/newlib_configure.log - -mkdir -p etc - -$MAKE | tee $BUILDSCRIPTDIR/newlib_make.log -$MAKE install | tee $BUILDSCRIPTDIR/newlib_install.log - -#--------------------------------------------------------------------------------- -# remove temp stuff to conserve disc space -#--------------------------------------------------------------------------------- -rm -fr $target/newlib -rm -fr $NEWLIB_SRCDIR - -#--------------------------------------------------------------------------------- -# build and install the final compiler -#--------------------------------------------------------------------------------- - -cd $BUILDSCRIPTDIR -cd $target/gcc - -$MAKE | tee $BUILDSCRIPTDIR/gcc_final_make.log 2>&1 -$MAKE install | tee $BUILDSCRIPTDIR/gcc_final_install.log 2>&1 - -cd $BUILDSCRIPTDIR - -#--------------------------------------------------------------------------------- -# remove temp stuff to conserve disc space -#--------------------------------------------------------------------------------- -rm -fr $target/gcc -rm -fr $GCC_SRCDIR diff --git a/dka-scripts/build-tools.sh b/dka-scripts/build-tools.sh deleted file mode 100644 index dfa4d86..0000000 --- a/dka-scripts/build-tools.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - - -export DEVKITARM=$TOOLPATH/devkitARM -export DEVKITPRO=$TOOLPATH - -$MAKE -C tools/gba -$MAKE -C tools/gba install PREFIX=$DEVKITARM/bin - -$MAKE -C tools/gp32 -$MAKE -C tools/gp32 install PREFIX=$DEVKITARM/bin - -$MAKE -C tools/nds/ -$MAKE -C tools/nds/ install PREFIX=$DEVKITARM/bin - -$MAKE -C tools clean diff --git a/dkp-crtls/gcn.ld b/dkp-crtls/gcn.ld deleted file mode 100644 index cd671b4..0000000 --- a/dkp-crtls/gcn.ld +++ /dev/null @@ -1,302 +0,0 @@ -/* Default linker script, for normal executables */ -OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", - "elf32-powerpc") -OUTPUT_ARCH(powerpc:common) -ENTRY(_start) -SEARCH_DIR("/powerpc/powerpc-eabi-elf/lib"); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ -PROVIDE (__stack = 0x817F0000); -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = 0x80003100; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rel.init : { *(.rel.init) } - .rela.init : { *(.rela.init) } - .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } - .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } - .rel.fini : { *(.rel.fini) } - .rela.fini : { *(.rela.fini) } - .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } - .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } - .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } - .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } - .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } - .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } - .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } - .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } - .rel.ctors : { *(.rel.ctors) } - .rela.ctors : { *(.rela.ctors) } - .rel.dtors : { *(.rel.dtors) } - .rela.dtors : { *(.rela.dtors) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rela.got1 : { *(.rela.got1) } - .rela.got2 : { *(.rela.got2) } - .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } - .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } - .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } - .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) } - .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } - .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } - .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } - .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } - .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } - .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - - /* DOL header (from TITANIK's GC docs) - */ - file_start = 0x80003000; - . = file_start; - - .header : - { - /* 0000-001B Text[0..6] sections File Positions */ - LONG(text_file_start); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - - /* 001C-0047 Data[0..10] sections File Positions */ - LONG(data_file_start); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - - /* 0048-0063 Text[0..6] sections Mem Address */ - LONG(text_mem_start); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - - /* 0064-008F Data[0..10] sections Mem Address */ - LONG(data_mem_start); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - - /* 0090-00AB Text[0..6] sections Sizes */ - LONG(text_mem_size); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - - /* 00AC-00D7 Data[0..10] sections Sizes */ - LONG(data_mem_size); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - LONG(0); - - /* 00D8 BSS Mem address - * 00DC BSS Size */ - LONG(bss_mem_start); - LONG(bss_mem_size); - - /* 00E0 Entry Point */ - LONG(ABSOLUTE(_start)); - } - - -. = 0x80003100; - text_mem_start = .; - - .init : - { - KEEP (*(.init)) - } =0 - .text : - { - *(.text .stub .text.* .gnu.linkonce.t.*) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - } =0 - .fini : - { - KEEP (*(.fini)) - } =0 - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - . = ALIGN(32); - text_mem_size = . - text_mem_start; - data_mem_start = .; - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } - .rodata1 : { *(.rodata1) } - .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } - .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } - .eh_frame_hdr : { *(.eh_frame_hdr) } - . = ALIGN(32); - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(32 / 8); - PROVIDE (__preinit_array_start = .); - .preinit_array : { *(.preinit_array) } - PROVIDE (__preinit_array_end = .); - PROVIDE (__init_array_start = .); - .init_array : { *(.init_array) } - PROVIDE (__init_array_end = .); - PROVIDE (__fini_array_start = .); - .fini_array : { *(.fini_array) } - PROVIDE (__fini_array_end = .); - .data : - { - *(.data .data.* .gnu.linkonce.d.*) - SORT(CONSTRUCTORS) - } - .data1 : { *(.data1) } - .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } - .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } - .eh_frame : { KEEP (*(.eh_frame)) } - .gcc_except_table : { *(.gcc_except_table) } - .fixup : { *(.fixup) } - .got1 : { *(.got1) } - .got2 : { *(.got2) } - .dynamic : { *(.dynamic) } - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin*.o(.ctors)) - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } - .dtors : - { - KEEP (*crtbegin*.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } - .jcr : { KEEP (*(.jcr)) } - .got : { *(.got.plt) *(.got) } - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata : - { - *(.sdata .sdata.* .gnu.linkonce.s.*) - } - _edata = .; - PROVIDE (edata = .); - -data_mem_size = . - data_mem_start; - bss_mem_start = .; - - __bss_start = .; - .sbss : - { - PROVIDE (__sbss_start = .); - PROVIDE (___sbss_start = .); - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.scommon) - PROVIDE (__sbss_end = .); - PROVIDE (___sbss_end = .); - } - .plt : { *(.plt) } - .bss : - { - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - /* Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections. */ - . = ALIGN(32 / 8); - } - . = ALIGN(32 / 8); - bss_mem_size = . - bss_mem_start; -text_file_start = text_mem_start - file_start; -data_file_start = data_mem_start - file_start; - - - _end = .; - __end = .; - PROVIDE (end = .); - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } -} diff --git a/dkp-crtls/gcn_crt0.o b/dkp-crtls/gcn_crt0.o deleted file mode 100644 index c6054106683f3f0e215111cc7650a0ba1de782c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2308 zcma)-UuYv$6vn@#sqIQvszj}Jk*QRyxRiBKjM|0S{@HCcNZr&Y#mpp`rLk$6O~&1H z8QammYoI>*5K#vN1s{A7L?R-H_@KV|7G0F$KZ=UT+HL&Ko!mMbS@gm$_k8Evd+xnw z?o2l4(x+na7!FztN!k%dVnW64SHBZDgzFB*(wGO%kt_4)yKBkcph)L3V4it`#=;gzvYi*sWd&qAV-g#2_ZIh)kjIYalpc_wnJioUwTJP5E znAAbdk$EyUj}31e@N>ZZ+(e zwdFc>7n23swK18i)i7CgO7>*2Ty!PF|8AokDc=wMod~}i|4i547QRtx9B;I0*BW;> zql4tX#@)v;(REEud6z!jhP%d5_6hA|>P6b`k%6vXVngIcqSq92mp=~@-Sj!6k83B; z-{3aBpq4!+iR2q5{DMXE4OrBYQ#YMY>wop!%vEEkBkQWb>IzLz{Lf=x8*92-$8)G6v{+@$_95`UEW--zfZxb5hAPf@2MafdoO zzD)f=B>n>RPZ7P%{8DRavcEuC{9(~W^Gh8zc?fLphh6wkXn)wFKk3n*_2@5q^w&N5 zyQ}m9U!T*9XEG3D-mVrd*i{Fa^_uIfiVM@3%uIT1tpcYczl#~=J+*j7^)q&U*-_TT zv!ylL#lp;7+0K=m0%i}a^zqXRnU!J%G)ikZyR=X~ZYx3+j@b9p{ zTZ5Zu%QKL6J8+Bk-$7gZO> $(*).h - echo "extern const u8" `(echo $(*) | tr . _)`"[];" >> $(*).h - echo "extern const u32" `(echo $(*) | tr . _)`_size[]";" >> $(*).h - rm $(*).tmp -endef - diff --git a/dkp-rules/gamecube_rules b/dkp-rules/gamecube_rules deleted file mode 100644 index 0bf2199..0000000 --- a/dkp-rules/gamecube_rules +++ /dev/null @@ -1,10 +0,0 @@ --include $(DEVKITPPC)/base_rules - -%.dol: %.elf - @echo output ... $(notdir $@) - @$(OBJCOPY) -O binary $< $@ - -#--------------------------------------------------------------------------------- -%.elf: - @echo linking ... $(notdir $@) - @$(LD) $^ $(LDFLAGS) $(LIBPATHS) $(LIBS) -o $@ diff --git a/dkp-scripts/build-crtls.sh b/dkp-scripts/build-crtls.sh deleted file mode 100644 index 99ec2a7..0000000 --- a/dkp-scripts/build-crtls.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -DEVKITPPC=$INSTALLDIR/devkitPPC - -#--------------------------------------------------------------------------------- -# Install and build the gamecube crt and libogc -#--------------------------------------------------------------------------------- - -echo "installing specs ..." -cp `pwd`/dkp-crtls/gcn* $DEVKITPPC/$target/lib/ -cp `pwd`/dkp-crtls/ogc.ld $DEVKITPPC/$target/lib/ -cp `pwd`/dkp-crtls/specs $DEVKITPPC/lib/gcc/$target/$GCC_VER/specs - -echo "building libogc ..." -cd $LIBOGC_SRCDIR -$MAKE -echo "installing libogc ..." -$MAKE install - -#--------------------------------------------------------------------------------- -# copy base rulesets -#--------------------------------------------------------------------------------- -cd $BUILDSCRIPTDIR -cp dkp-rules/* $DEVKITPPC - - diff --git a/dkp-scripts/build-gcc.sh b/dkp-scripts/build-gcc.sh deleted file mode 100644 index 6ea6ee1..0000000 --- a/dkp-scripts/build-gcc.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh -#--------------------------------------------------------------------------------- -# Check Parameters -#--------------------------------------------------------------------------------- - -prefix=$INSTALLDIR/devkitPPC - -#--------------------------------------------------------------------------------- -# build and install binutils -#--------------------------------------------------------------------------------- - -mkdir -p $target/binutils -cd $target/binutils - -../../$BINUTILS_SRCDIR/configure \ - --prefix=$prefix --target=$target --disable-nls --disable-shared --disable-debug \ - --with-gcc --with-gnu-as --with-gnu-ld --with-stabs \ - 2>&1 | tee binutils_configure.log - - -$MAKE | tee binutils_make.log 2>&1 -$MAKE install | tee binutils_install.log 2>&1 - -cd $BUILDSCRIPTDIR - -#--------------------------------------------------------------------------------- -# remove temp stuff to conserve disc space -#--------------------------------------------------------------------------------- -rm -fr $target/binutils -rm -fr $BINUTILS_SRCDIR - -#--------------------------------------------------------------------------------- -# build and install just the c compiler -#--------------------------------------------------------------------------------- -mkdir -p $target/gcc -cd $target/gcc - - -../../$GCC_SRCDIR/configure \ - --enable-languages=c,c++ \ - --with-cpu=750\ - --with-gcc --with-gnu-ld --with-gnu-as --with-stabs \ - --with-included-gettext --without-headers\ - --disable-nls --disable-shared --enable-threads --disable-multilib\ - --disable-win32-registry\ - --target=$target \ - --with-newlib \ - --prefix=$prefix -v\ - 2>&1 | tee gcc_configure.log - -$MAKE all-gcc | tee gcc_make.log 2>&1 -$MAKE install-gcc | tee gcc_install.log 2>&1 - -#--------------------------------------------------------------------------------- -# build and install newlib -#--------------------------------------------------------------------------------- -cd $BUILDSCRIPTDIR -mkdir -p $target/newlib -cd $target/newlib -mkdir -p etc - -$BUILDSCRIPTDIR/$NEWLIB_SRCDIR/configure --target=$target \ - --prefix=$prefix \ - --enable-serial-configure \ - --enable-newlib-mb \ - | tee newlib_configure.log 2>&1 - -$MAKE all | tee newlib_make.log 2>&1 -$MAKE install | tee newlib_install.log 2>&1 - -cd $BUILDSCRIPTDIR - -#--------------------------------------------------------------------------------- -# remove temp stuff to conserve disc space -#--------------------------------------------------------------------------------- -rm -fr $target/newlib -rm -fr $NEWLIB_SRCDIR - -#--------------------------------------------------------------------------------- -# build and install the final compiler -#--------------------------------------------------------------------------------- - -cd $target/gcc - -$MAKE | tee gcc_final_make.log 2>&1 -$MAKE install | tee gcc_final_install.log 2>&1 - -cd $BUILDSCRIPTDIR - -#--------------------------------------------------------------------------------- -# remove temp stuff to conserve disc space -#--------------------------------------------------------------------------------- -rm -fr $target/gcc -rm -fr $GCC_SRCDIR