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 .rodata : { *(.rodata*) } > kseg0_program_mem AT > physical_program_mem 55 .got : { 56 _gp = ALIGN(16); 57 *(.got*) 58 } > kseg0_program_mem AT > physical_program_mem 59 60 /* Store initialised non-constant data in program memory for relocation. 61 Employ data memory addresses for generated content. */ 62 63 .data : { 64 _data = .; 65 *(.data*) 66 _data_end = .; 67 } > kseg0_data_mem AT > physical_program_mem 68 69 _data_original = LOADADDR(.data) - ORIGIN(physical_program_mem) + ORIGIN(kseg0_program_mem); 70 _data_size = SIZEOF(.data); 71 72 /* Device configuration registers to be flashed. */ 73 74 .devcfg0 : { *(.devcfg0) } > config0 AT > physical_config0 75 .devcfg1 : { *(.devcfg1) } > config1 AT > physical_config1 76 .devcfg2 : { *(.devcfg2) } > config2 AT > physical_config2 77 78 /* Discard things that might overwrite useful data. */ 79 80 /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.pdr) *(.gnu.attributes) *(.comment) } 81 }