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