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