Home | History | Annotate | Line # | Download | only in conf
kern.ldscript revision 1.11
      1 /*	$NetBSD: kern.ldscript,v 1.11 2010/06/01 22:13:30 mjf Exp $	*/
      2 
      3 /*
      4  * Kernel linker script for NetBSD/sparc64.  This script is based on
      5  * elf64_sparc.xn, but puts _etext after all of the read-only sections.
      6  */
      7 OUTPUT_FORMAT("elf64-sparc", "elf64-sparc",
      8 	      "elf64-sparc")
      9 OUTPUT_ARCH(sparc:v9)
     10 ENTRY(_start)
     11 SEARCH_DIR(/usr/lib);
     12 /* Do we need any of these for elf?
     13    __DYNAMIC = 0;    */
     14 SECTIONS
     15 {
     16   /* Read-only sections, merged into text segment: */
     17   . = 0x100000 + SIZEOF_HEADERS;
     18   .interp     : { *(.interp) 	}
     19   .hash          : { *(.hash)		}
     20   .dynsym        : { *(.dynsym)		}
     21   .dynstr        : { *(.dynstr)		}
     22   .gnu.version   : { *(.gnu.version)	}
     23   .gnu.version_d   : { *(.gnu.version_d)	}
     24   .gnu.version_r   : { *(.gnu.version_r)	}
     25   .rel.text      :
     26     { *(.rel.text) *(.rel.gnu.linkonce.t*) }
     27   .rela.text     :
     28     { *(.rela.text) *(.rela.gnu.linkonce.t*) }
     29   .rel.data      :
     30     { *(.rel.data) *(.rel.gnu.linkonce.d*) }
     31   .rela.data     :
     32     { *(.rela.data) *(.rela.gnu.linkonce.d*) }
     33   .rel.rodata    :
     34     { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
     35   .rela.rodata   :
     36     { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
     37   .rel.got       : { *(.rel.got)		}
     38   .rela.got      : { *(.rela.got)		}
     39   .rel.ctors     : { *(.rel.ctors)	}
     40   .rela.ctors    : { *(.rela.ctors)	}
     41   .rel.dtors     : { *(.rel.dtors)	}
     42   .rela.dtors    : { *(.rela.dtors)	}
     43   .rel.init      : { *(.rel.init)	}
     44   .rela.init     : { *(.rela.init)	}
     45   .rel.fini      : { *(.rel.fini)	}
     46   .rela.fini     : { *(.rela.fini)	}
     47   .rel.bss       : { *(.rel.bss)		}
     48   .rela.bss      : { *(.rela.bss)		}
     49   .rel.plt       : { *(.rel.plt)		}
     50   .rela.plt      : { *(.rela.plt)		}
     51   .init          : { *(.init)	} =0x01000000
     52   .text      :
     53   {
     54     *(.text)
     55     *(.stub)
     56     /* .gnu.warning sections are handled specially by elf32.em.  */
     57     *(.gnu.warning)
     58     *(.gnu.linkonce.t*)
     59   } =0x01000000
     60   .fini      : { *(.fini)    } =0x01000000
     61   .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
     62   .rodata1   : { *(.rodata1) }
     63   _etext = .;
     64   PROVIDE (etext = .);
     65   /* Adjust the address for the data segment.  We push the data segment
     66      up to the next 4MB boundary so that we can map the text with large
     67      pages. */
     68   . = ALIGN(0x400000);
     69   kernel_data_start = .;
     70   .data    :
     71   {
     72     *(.data)
     73     *(.gnu.linkonce.d*)
     74     CONSTRUCTORS
     75   }
     76   .data1   : { *(.data1) }
     77   . = ALIGN(64);	/* COHERENCY_UNIT */
     78   .data.cacheline_aligned	: { *(.data.cacheline_aligned) }
     79   . = ALIGN(64);	/* COHERENCY_UNIT */
     80   .data.read_mostly		: { *(.data.read_mostly) }
     81   . = ALIGN(64);	/* COHERENCY_UNIT */
     82   .ctors         :
     83   {
     84     *(.ctors)
     85   }
     86   .dtors         :
     87   {
     88     *(.dtors)
     89   }
     90   .plt      : { *(.plt)	}
     91   .got           : { *(.got.plt) *(.got) }
     92   .dynamic       : { *(.dynamic) }
     93   /* We want the small data sections together, so single-instruction offsets
     94      can access them all, and initialized data all before uninitialized, so
     95      we can shorten the on-disk segment size.  */
     96   .sdata     : { *(.sdata) }
     97   _edata  =  .;
     98   PROVIDE (edata = .);
     99   __bss_start = .;
    100   .sbss      : { *(.sbss) *(.scommon) }
    101   .bss       :
    102   {
    103    *(.dynbss)
    104    *(.bss)
    105    *(COMMON)
    106   }
    107   . = ALIGN(64 / 8);
    108   _end = . ;
    109   PROVIDE (end = .);
    110   /* Stabs debugging sections.  */
    111   .stab 0 : { *(.stab) }
    112   .stabstr 0 : { *(.stabstr) }
    113   .stab.excl 0 : { *(.stab.excl) }
    114   .stab.exclstr 0 : { *(.stab.exclstr) }
    115   .stab.index 0 : { *(.stab.index) }
    116   .stab.indexstr 0 : { *(.stab.indexstr) }
    117   .comment 0 : { *(.comment) }
    118   /* DWARF debug sections.
    119      Symbols in the DWARF debugging sections are relative to the beginning
    120      of the section so we begin them at 0.  */
    121   /* DWARF 1 */
    122   .debug          0 : { *(.debug) }
    123   .line           0 : { *(.line) }
    124   /* GNU DWARF 1 extensions */
    125   .debug_srcinfo  0 : { *(.debug_srcinfo) }
    126   .debug_sfnames  0 : { *(.debug_sfnames) }
    127   /* DWARF 1.1 and DWARF 2 */
    128   .debug_aranges  0 : { *(.debug_aranges) }
    129   .debug_pubnames 0 : { *(.debug_pubnames) }
    130   /* DWARF 2 */
    131   .debug_info     0 : { *(.debug_info) }
    132   .debug_abbrev   0 : { *(.debug_abbrev) }
    133   .debug_line     0 : { *(.debug_line) }
    134   .debug_frame    0 : { *(.debug_frame) }
    135   .debug_str      0 : { *(.debug_str) }
    136   .debug_loc      0 : { *(.debug_loc) }
    137   .debug_macinfo  0 : { *(.debug_macinfo) }
    138   /* SGI/MIPS DWARF 2 extensions */
    139   .debug_weaknames 0 : { *(.debug_weaknames) }
    140   .debug_funcnames 0 : { *(.debug_funcnames) }
    141   .debug_typenames 0 : { *(.debug_typenames) }
    142   .debug_varnames  0 : { *(.debug_varnames) }
    143   /* These must appear regardless of  .  */
    144   .note.netbsd.ident :
    145   {
    146     KEEP(*(.note.netbsd.ident));
    147   }
    148 }
    149