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 .flash : { 38 39 /* Exception/interrupt vectors and general program code. */ 40 41 *(.vectors*) 42 43 /* Global offset table. */ 44 45 _gp = ALIGN(16); 46 *(.got*) 47 48 /* Program code. */ 49 50 *(.text*) 51 52 /* Store constant data in program memory. */ 53 54 *(.rodata*) 55 56 } > kseg0_program_mem AT > physical_program_mem 57 58 /* Reserve space at the bottom of RAM for the IRQ stack. */ 59 60 .irqstack : { 61 . += IRQ_STACK_SIZE; 62 } > kseg0_data_mem AT > physical_data_mem 63 64 /* Store initialised non-constant data in program memory for relocation. 65 Employ data memory addresses for generated content. */ 66 67 .data : { 68 _data = .; 69 *(.data*) 70 } > kseg0_data_mem AT > physical_program_mem 71 72 _data_original = LOADADDR(.data) - ORIGIN(physical_program_mem) + ORIGIN(kseg0_program_mem); 73 _data_size = SIZEOF(.data); 74 75 /* Reserve space for uninitialised data. */ 76 77 .bss : { 78 _bss = .; 79 *(.bss*) 80 } > kseg0_data_mem AT > physical_data_mem 81 82 _bss_size = SIZEOF(.bss); 83 84 /* Device configuration registers to be flashed. */ 85 86 .devcfg0 : { *(.devcfg0) } > config0 AT > physical_config0 87 .devcfg1 : { *(.devcfg1) } > config1 AT > physical_config1 88 .devcfg2 : { *(.devcfg2) } > config2 AT > physical_config2 89 90 /* Discard things that might overwrite useful data. */ 91 92 /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.pdr) *(.gnu.attributes) *(.comment) } 93 }