Fix linker scripts

This commit is contained in:
TuxSH 2017-02-23 19:30:09 +01:00
parent bf7e30539e
commit b1b81c87f2
5 changed files with 34 additions and 21 deletions

View File

@ -1,11 +1,12 @@
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0;
.text.start : { *(.text.start) }
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss COMMON) }
.rodata : { *(.rodata) }
.text : ALIGN(4) { *(.text.start) *(.text*)}
.rodata : ALIGN(4) { *(.rodata*) }
.data : ALIGN(4) { *(.data*) *(.bss* COMMON)}
. = ALIGN(4);
}

View File

@ -1,11 +1,12 @@
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x01FF7FE0;
.text.start : { *(.text.start) }
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss COMMON) }
.rodata : { *(.rodata) }
.text : ALIGN(4) { *(.text.start) *(.text*)}
.rodata : ALIGN(4) { *(.rodata*) }
.data : ALIGN(4) { *(.data*) *(.bss* COMMON)}
. = ALIGN(4);
}

View File

@ -1,11 +1,15 @@
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x23F00000;
.text.start : { *(.text.start) }
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss COMMON) }
.rodata : { *(.rodata) }
.text : ALIGN(4) { *(.text.start) *(.text*) }
.rodata : ALIGN(4) { *(.rodata*) }
.data : ALIGN(4) { *(.data*) }
.bss : ALIGN(4) { __bss_start = .; *(.bss* COMMON); __bss_end = .;}
. = ALIGN(4);
}

View File

@ -1,11 +1,12 @@
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x24FFFE00;
.text.start : { *(.text.start) }
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss COMMON) }
.rodata : { *(.rodata) }
.text : ALIGN(4) { *(.text.start) *(.text*)}
.rodata : ALIGN(4) { *(.rodata*) }
.data : ALIGN(4) { *(.data*) *(.bss* COMMON)}
. = ALIGN(4);
}

View File

@ -58,7 +58,7 @@ start:
@ Set MPU permissions and cache settings
ldr r0, =0xFFFF001D @ ffff0000 32k | bootrom (unprotected part)
ldr r1, =0x01FF801D @ 01ff8000 32k | itcm
ldr r2, =0x08000029 @ 08000000 2M | arm9 mem (O3DS / N3DS)
ldr r2, =0x08000029 @ 08000000 2M | arm9 mem (O3DS / N3DS)
ldr r3, =0x10000029 @ 10000000 2M | io mem (ARM9 / first 2MB)
ldr r4, =0x20000037 @ 20000000 256M | fcram (O3DS / N3DS)
ldr r5, =0x1FF00027 @ 1FF00000 1M | dsp / axi wram
@ -91,4 +91,10 @@ start:
mov r1, #0x340
str r1, [r0]
ldr r0, =__bss_start
mov r1, #0
ldr r2, =__bss_end
sub r2, r0
bl memset32
b main