bullshit commit, sync for travel (to zn00H!) :)
[my-code/arm.git] / betty / lpc2220_rom.ld
index 11fa38d..40ed2ab 100644 (file)
@@ -8,9 +8,9 @@
 /* memory definitions */
 
 MEMORY {
-       FLASH_BANK0 (rx) : ORIGIN=0x80000000, LENGTH=0x00100000
-       FLASH_BANK2 (rx) : ORIGIN=0x82000000, LENGTH=0x00100000
-       RAM (rw) : ORIGIN=0x40000000, LENGTH=0x00010000
+       FLASH_BANK0 (rx) : ORIGIN = 0x80000000, LENGTH = 0x00100000
+       FLASH_BANK2 (rx) : ORIGIN = 0x82000000, LENGTH = 0x00100000
+       RAM (rw) : ORIGIN = 0x40000000, LENGTH = 0x00010000 - (4 * 1024)
 }
 
 /* section definitions */
@@ -19,25 +19,40 @@ SECTIONS {
        
        /* startup and user code (.text) */
        .text : {
-               startup.o(.text)        // startup code
-               *(.text)                // our code
-               *(.glue_7)              // glue code
-               *(.glue_7t)             // glue code
+               startup.o(.text)
+               *(.text)
+               *(.glue_7)
+               *(.glue_7t)
        } > FLASH_BANK0
 
-       . = ALIGN(4)
+       . = ALIGN(4);
 
        /* read only data */
-       .rodata : { *(.rodata) } > FLASH_BANK0
+       .rodata : { *(.rodata*) } > FLASH_BANK0
+
+       . = ALIGN(4);
 
-       . = ALIGN(4)
+       /* define text end symbol */
+       _etext = .;
+       PROVIDE(etext = .);
 
        /* initialized data */
-       .data : { *(.data) } > RAM
+       .data : {
+               _data = .;
+               *(.data)
+       } > RAM AT > FLASH_BANK0
 
        . = ALIGN(4);
 
+       /* define data end symbol */
+       _edata = .;
+       PROVIDE(edata = .);
+
        /* uninitialized data */
-       .bss : { *(.bss) } > RAM
+       .bss (NOLOAD) : { *(.bss) } > RAM
+
+       /* define bss end symbol */
+       _bss_end = .;
+       PROVIDE(bss_end = .);
 }