1 OUTPUT_ARCH(mips) 2 ENTRY(_start) 3 4 IRQ_STACK_SIZE = 256; 5 6 /* See... 7 * FIGURE 4-5: MEMORY MAP ON RESET FOR PIC32MX170/270 DEVICES (64 KB RAM, 256 KB FLASH) 8 * PIC32MX1XX/2XX 28/36/44-pin Family Data Sheet 9 */ 10 11 MEMORY 12 { 13 kseg0_boot_mem (rx) : ORIGIN = 0x9FC00000, LENGTH = 0xBF0 14 kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x40000 15 kseg0_data_mem (w!x) : ORIGIN = 0x80000000, LENGTH = 0x10000 16 physical_boot_mem (rx) : ORIGIN = 0x1FC00000, LENGTH = 0xBF0 17 physical_program_mem (rx) : ORIGIN = 0x1D000000, LENGTH = 0x40000 18 physical_data_mem (w!x) : ORIGIN = 0x00000000, LENGTH = 0x10000 19 sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000 20 configsfrs : ORIGIN = 0xBFC00BF0, LENGTH = 0x10 21 config3 : ORIGIN = 0xBFC00BF0, LENGTH = 0x4 22 config2 : ORIGIN = 0xBFC00BF4, LENGTH = 0x4 23 config1 : ORIGIN = 0xBFC00BF8, LENGTH = 0x4 24 config0 : ORIGIN = 0xBFC00BFC, LENGTH = 0x4 25 physical_config3 : ORIGIN = 0x3FC00BF0, LENGTH = 0x4 26 physical_config2 : ORIGIN = 0x3FC00BF4, LENGTH = 0x4 27 physical_config1 : ORIGIN = 0x3FC00BF8, LENGTH = 0x4 28 physical_config0 : ORIGIN = 0x3FC00BFC, LENGTH = 0x4 29 } 30 31 SECTIONS 32 { 33 /* Boot program. */ 34 35 .boot : { *(.boot*) } > kseg0_boot_mem AT > physical_boot_mem 36 37 /* Exception/interrupt vectors and general program code. */ 38 39 .vectors : { *(.vectors*) } > kseg0_program_mem AT > physical_program_mem 40 .text : { *(.text*) } > kseg0_program_mem AT > physical_program_mem 41 42 /* Reserve space at the bottom of RAM for the IRQ stack. */ 43 44 .irqstack : { 45 . += IRQ_STACK_SIZE; 46 } > kseg0_data_mem AT > physical_data_mem 47 48 /* Add other data after the IRQ stack. */ 49 50 .bss : { *(.bss*) } > kseg0_data_mem AT > physical_data_mem 51 52 /* Store constant data in program memory. */ 53 54 .data : { *(.data*) } > kseg0_program_mem AT > physical_program_mem 55 .rodata : { *(.rodata*) } > kseg0_program_mem AT > physical_program_mem 56 .got : { 57 _gp = ALIGN(16); 58 *(.got*) 59 } > kseg0_program_mem AT > physical_program_mem 60 61 /* Device configuration registers to be flashed. */ 62 63 .devcfg0 : { *(.devcfg0) } > config0 AT > physical_config0 64 .devcfg1 : { *(.devcfg1) } > config1 AT > physical_config1 65 .devcfg2 : { *(.devcfg2) } > config2 AT > physical_config2 66 67 /* Discard things that might overwrite useful data. */ 68 69 /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.pdr) *(.gnu.attributes) *(.comment) } 70 }