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