rom.lk 1.96 KB
SECTIONS
{
  . = 0xbfc00000;

  .cpram :
  {
    entry.o(.text)
  } >rom_copy

  .handler1 :
  {
    handler1.o(.text)
  } >rom_exception1

  .handler2 :
  {
    handler2.o(.text)
  } >rom_exception2

  .handler3 :
  {
    handler3.o(.text)
  } >rom_exception3

  . = 0xbfc40000; /* start of isram, kseg1 */

  /* textu holds uncached text. Code running uncached must */
  /* not have data or bss sections (should all be asm).    */
  /* The LMA is at 0x400 into rom to leave space for the   */
  /* MIPS exception handlers.                              */
  .textu : AT(0xbfc00400)
  { 
    __s_text = .; /* define symbol at text start */
    bootu.o(.text)
  }

  __s_la_text = LOADADDR(.textu);
  . = . - 0x20000000; /* code from here linked to kseg0 */

  .text : AT(0xbfc00400 + SIZEOF(.textu))
  {
    *(.text)
  }

  .rodata : AT(0xbfc00400 + SIZEOF(.textu) + SIZEOF(.text))
  {
    *(.rodata)
    __e_text = . + 0x20000000; /* define symbol at end of text */
  }
  
  /* we actually shouldn't have anything below here in boot code */

  /* watch out - if no .rodata from objects and no declarations,  */
  /* we'll get a forward reference error on .rodata in next line. */
  .data : AT(0xbfc00400 + SIZEOF(.textu) + SIZEOF(.text) 
             + SIZEOF(.rodata)) 
  { 
    *(.data) 
  }
  _gp = .;
  .sbss :
  { 
    __s_sbss = .; /* define symbol at bss start */
    *(.sbss) *(.scommon)
    __e_sbss = .; /* define symbol at bss end */
  }
  .bss :
  { 
    __s_bss = .; /* define symbol at bss start */
    *(.bss) 
    __e_bss = .; /* define symbol at bss end */
  }

  /* bogus area for reginfo to hide */
  . = 0x4000;
  .reginfo : { *(.reginfo) }
}

/* rom length is 8K (0x2000) */
MEMORY
{
  /* rom_copy code executes out of rom */
  rom_copy :       ORIGIN = 0xbfc00000, LENGTH = 0x200

  /* space for MIPS exception handlers */
  rom_exception1 : ORIGIN = 0xbfc00200, LENGTH = 0x80
  rom_exception2 : ORIGIN = 0xbfc00280, LENGTH = 0x100
  rom_exception3 : ORIGIN = 0xbfc00380, LENGTH = 0x80

}