kern.ldscript revision 1.8
11.8Smartin/*	$NetBSD: kern.ldscript,v 1.8 2006/12/05 16:17:20 martin Exp $	*/
21.2Smrg
31.2Smrg/*
41.2Smrg * Kernel linker script for NetBSD/sparc64.  This script is based on
51.2Smrg * elf64_sparc.xn, but puts _etext after all of the read-only sections.
61.2Smrg */
71.1SmrgOUTPUT_FORMAT("elf64-sparc", "elf64-sparc",
81.1Smrg	      "elf64-sparc")
91.1SmrgOUTPUT_ARCH(sparc:v9)
101.1SmrgENTRY(_start)
111.1SmrgSEARCH_DIR(/usr/lib);
121.1Smrg/* Do we need any of these for elf?
131.1Smrg   __DYNAMIC = 0;    */
141.1SmrgSECTIONS
151.1Smrg{
161.1Smrg  /* Read-only sections, merged into text segment: */
171.6Smartin  . = 0x100000 + SIZEOF_HEADERS;
181.1Smrg  .interp     : { *(.interp) 	}
191.1Smrg  .hash          : { *(.hash)		}
201.1Smrg  .dynsym        : { *(.dynsym)		}
211.1Smrg  .dynstr        : { *(.dynstr)		}
221.1Smrg  .gnu.version   : { *(.gnu.version)	}
231.1Smrg  .gnu.version_d   : { *(.gnu.version_d)	}
241.1Smrg  .gnu.version_r   : { *(.gnu.version_r)	}
251.1Smrg  .rel.text      :
261.1Smrg    { *(.rel.text) *(.rel.gnu.linkonce.t*) }
271.1Smrg  .rela.text     :
281.1Smrg    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
291.1Smrg  .rel.data      :
301.1Smrg    { *(.rel.data) *(.rel.gnu.linkonce.d*) }
311.1Smrg  .rela.data     :
321.1Smrg    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
331.1Smrg  .rel.rodata    :
341.1Smrg    { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
351.1Smrg  .rela.rodata   :
361.1Smrg    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
371.1Smrg  .rel.got       : { *(.rel.got)		}
381.1Smrg  .rela.got      : { *(.rela.got)		}
391.1Smrg  .rel.ctors     : { *(.rel.ctors)	}
401.1Smrg  .rela.ctors    : { *(.rela.ctors)	}
411.1Smrg  .rel.dtors     : { *(.rel.dtors)	}
421.1Smrg  .rela.dtors    : { *(.rela.dtors)	}
431.1Smrg  .rel.init      : { *(.rel.init)	}
441.1Smrg  .rela.init     : { *(.rela.init)	}
451.1Smrg  .rel.fini      : { *(.rel.fini)	}
461.1Smrg  .rela.fini     : { *(.rela.fini)	}
471.1Smrg  .rel.bss       : { *(.rel.bss)		}
481.1Smrg  .rela.bss      : { *(.rela.bss)		}
491.1Smrg  .rel.plt       : { *(.rel.plt)		}
501.1Smrg  .rela.plt      : { *(.rela.plt)		}
511.1Smrg  .init          : { *(.init)	} =0x01000000
521.1Smrg  .text      :
531.1Smrg  {
541.1Smrg    *(.text)
551.1Smrg    *(.stub)
561.1Smrg    /* .gnu.warning sections are handled specially by elf32.em.  */
571.1Smrg    *(.gnu.warning)
581.1Smrg    *(.gnu.linkonce.t*)
591.1Smrg  } =0x01000000
601.1Smrg  .fini      : { *(.fini)    } =0x01000000
611.1Smrg  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
621.1Smrg  .rodata1   : { *(.rodata1) }
631.2Smrg  _etext = .;
641.2Smrg  PROVIDE (etext = .);
651.1Smrg  /* Adjust the address for the data segment.  We want to adjust up to
661.1Smrg     the same address within the page on the next page up.  */
671.1Smrg  . = ALIGN(0x100000) + (. & (0x100000 - 1));
681.2Smrg  kernel_data_start = .;
691.1Smrg  .data    :
701.1Smrg  {
711.1Smrg    *(.data)
721.1Smrg    *(.gnu.linkonce.d*)
731.1Smrg    CONSTRUCTORS
741.1Smrg  }
751.1Smrg  .data1   : { *(.data1) }
761.1Smrg  .ctors         :
771.1Smrg  {
781.1Smrg    *(.ctors)
791.1Smrg  }
801.1Smrg  .dtors         :
811.1Smrg  {
821.1Smrg    *(.dtors)
831.1Smrg  }
841.1Smrg  .plt      : { *(.plt)	}
851.1Smrg  .got           : { *(.got.plt) *(.got) }
861.1Smrg  .dynamic       : { *(.dynamic) }
871.1Smrg  /* We want the small data sections together, so single-instruction offsets
881.1Smrg     can access them all, and initialized data all before uninitialized, so
891.1Smrg     we can shorten the on-disk segment size.  */
901.1Smrg  .sdata     : { *(.sdata) }
911.1Smrg  _edata  =  .;
921.1Smrg  PROVIDE (edata = .);
931.1Smrg  __bss_start = .;
941.1Smrg  .sbss      : { *(.sbss) *(.scommon) }
951.1Smrg  .bss       :
961.1Smrg  {
971.1Smrg   *(.dynbss)
981.1Smrg   *(.bss)
991.1Smrg   *(COMMON)
1001.1Smrg  }
1011.1Smrg  . = ALIGN(64 / 8);
1021.1Smrg  _end = . ;
1031.1Smrg  PROVIDE (end = .);
1041.1Smrg  /* Stabs debugging sections.  */
1051.1Smrg  .stab 0 : { *(.stab) }
1061.1Smrg  .stabstr 0 : { *(.stabstr) }
1071.1Smrg  .stab.excl 0 : { *(.stab.excl) }
1081.1Smrg  .stab.exclstr 0 : { *(.stab.exclstr) }
1091.1Smrg  .stab.index 0 : { *(.stab.index) }
1101.1Smrg  .stab.indexstr 0 : { *(.stab.indexstr) }
1111.1Smrg  .comment 0 : { *(.comment) }
1121.1Smrg  /* DWARF debug sections.
1131.1Smrg     Symbols in the DWARF debugging sections are relative to the beginning
1141.1Smrg     of the section so we begin them at 0.  */
1151.1Smrg  /* DWARF 1 */
1161.1Smrg  .debug          0 : { *(.debug) }
1171.1Smrg  .line           0 : { *(.line) }
1181.1Smrg  /* GNU DWARF 1 extensions */
1191.1Smrg  .debug_srcinfo  0 : { *(.debug_srcinfo) }
1201.1Smrg  .debug_sfnames  0 : { *(.debug_sfnames) }
1211.1Smrg  /* DWARF 1.1 and DWARF 2 */
1221.1Smrg  .debug_aranges  0 : { *(.debug_aranges) }
1231.1Smrg  .debug_pubnames 0 : { *(.debug_pubnames) }
1241.1Smrg  /* DWARF 2 */
1251.1Smrg  .debug_info     0 : { *(.debug_info) }
1261.1Smrg  .debug_abbrev   0 : { *(.debug_abbrev) }
1271.1Smrg  .debug_line     0 : { *(.debug_line) }
1281.1Smrg  .debug_frame    0 : { *(.debug_frame) }
1291.1Smrg  .debug_str      0 : { *(.debug_str) }
1301.1Smrg  .debug_loc      0 : { *(.debug_loc) }
1311.1Smrg  .debug_macinfo  0 : { *(.debug_macinfo) }
1321.1Smrg  /* SGI/MIPS DWARF 2 extensions */
1331.1Smrg  .debug_weaknames 0 : { *(.debug_weaknames) }
1341.1Smrg  .debug_funcnames 0 : { *(.debug_funcnames) }
1351.1Smrg  .debug_typenames 0 : { *(.debug_typenames) }
1361.1Smrg  .debug_varnames  0 : { *(.debug_varnames) }
1371.1Smrg  /* These must appear regardless of  .  */
1381.8Smartin  .note.netbsd.ident :
1391.8Smartin  {
1401.8Smartin    KEEP(*(.note.netbsd.ident));
1411.8Smartin  }
1421.1Smrg}
143