Home | History | Annotate | Line # | Download | only in conf
kern.ldscript revision 1.7
      1  1.7  uebayasi /* $NetBSD: kern.ldscript,v 1.7 2015/08/20 07:00:49 uebayasi Exp $ */
      2  1.2      matt 
      3  1.6       mrg /*  ldscript for NetBSD/powerpc kernels and LKMs, based on elf32ppc.x */
      4  1.6       mrg OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
      5  1.6       mrg 	      "elf32-powerpc")
      6  1.6       mrg OUTPUT_ARCH(powerpc:common)
      7  1.2      matt ENTRY(_start)
      8  1.2      matt SEARCH_DIR(/lib);
      9  1.2      matt /* Do we need any of these?
     10  1.2      matt    __DYNAMIC = 0;    */
     11  1.2      matt _DYNAMIC_LINK = 0;
     12  1.2      matt SECTIONS
     13  1.2      matt {
     14  1.2      matt   /*  Read-only sections, merged into text segment.  Assumes the
     15  1.2      matt       kernel Makefile sets the start address via -Ttext.  */
     16  1.2      matt   .text      :
     17  1.2      matt   {
     18  1.2      matt     _ftext = . ;
     19  1.6       mrg     PROVIDE_HIDDEN (__eprol = .);
     20  1.2      matt     *(.text)
     21  1.6       mrg     *(.text.unlikely .text.*_unlikely)
     22  1.6       mrg     *(.text.exit .text.exit.*)
     23  1.6       mrg     *(.text.startup .text.startup.*)
     24  1.6       mrg     *(.text.hot .text.hot.*)
     25  1.6       mrg     *(.text.* .gnu.linkonce.t.*)
     26  1.2      matt     __stub_start = .;
     27  1.2      matt     *(.stub)
     28  1.2      matt     __stub_end = .;
     29  1.4      matt     __stub_pmap_start = .;
     30  1.4      matt     *(.stub.pmap)
     31  1.4      matt     __stub_pmap_end = .;
     32  1.6       mrg     /* .gnu.warning sections are handled specially by elf32.em.  */
     33  1.2      matt     *(.gnu.warning)
     34  1.6       mrg     *(.glink)
     35  1.2      matt   } =0
     36  1.2      matt   _etext = .;
     37  1.6       mrg   PROVIDE (__etext = .);
     38  1.6       mrg   PROVIDE (_etext = .);
     39  1.2      matt   PROVIDE (etext = .);
     40  1.6       mrg   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
     41  1.6       mrg   .rodata1        : { *(.rodata1) }
     42  1.6       mrg   .sdata2         :
     43  1.6       mrg   {
     44  1.6       mrg     PROVIDE (_SDA2_BASE_ = 32768);
     45  1.6       mrg     *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
     46  1.6       mrg   }
     47  1.6       mrg   .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
     48  1.6       mrg   /*.jcr            : { KEEP (*(.jcr)) } */ /* XXX??? */
     49  1.2      matt   .reginfo : { *(.reginfo) }
     50  1.2      matt /*  . = . + 0x1000; */
     51  1.6       mrg   .data           :
     52  1.2      matt   {
     53  1.2      matt     _fdata = . ;
     54  1.6       mrg     *(.data .data.* .gnu.linkonce.d.*)
     55  1.6       mrg     SORT(CONSTRUCTORS)
     56  1.2      matt   }
     57  1.6       mrg   .data1          : { *(.data1) }
     58  1.3      matt   . = ALIGN(32);	/* COHERENCY UNIT */
     59  1.3      matt   .data.cacheline_aligned	: { *(.data.cacheline_aligned) }
     60  1.3      matt   . = ALIGN(32);	/* COHERENCY UNIT */
     61  1.3      matt   .data.read_mostly		: { *(.data.read_mostly) }
     62  1.3      matt   . = ALIGN(32);	/* COHERENCY UNIT */
     63  1.2      matt   _gp = ALIGN(16) + 0x7ff0;
     64  1.2      matt   .lit8 : { *(.lit8) }
     65  1.2      matt   .lit4 : { *(.lit4) }
     66  1.6       mrg   .sdata          :
     67  1.6       mrg   {
     68  1.6       mrg     PROVIDE (_SDA_BASE_ = 32768);
     69  1.6       mrg     *(.sdata .sdata.* .gnu.linkonce.s.*)
     70  1.6       mrg   }
     71  1.6       mrg   _edata = .; PROVIDE (edata = .);
     72  1.6       mrg   . = .;
     73  1.2      matt   __bss_start = .;
     74  1.2      matt   _fbss = .;
     75  1.6       mrg   .sbss           :
     76  1.2      matt   {
     77  1.6       mrg     PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
     78  1.6       mrg     *(.dynsbss)
     79  1.6       mrg     *(.sbss .sbss.* .gnu.linkonce.sb.*)
     80  1.6       mrg     *(.scommon)
     81  1.6       mrg     PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
     82  1.6       mrg   }
     83  1.6       mrg   .bss            :
     84  1.6       mrg   {
     85  1.7  uebayasi     *(.dynbss)
     86  1.7  uebayasi     *(.bss .bss.* .gnu.linkonce.b.*)
     87  1.7  uebayasi     *(COMMON)
     88  1.7  uebayasi     /* Align here to ensure that the .bss section occupies space up to
     89  1.7  uebayasi        _end.  Align after .bss to ensure correct alignment even if the
     90  1.7  uebayasi        .bss section disappears because there are no input sections.
     91  1.7  uebayasi        FIXME: Why do we need it? When there is no .bss section, we don't
     92  1.7  uebayasi        pad the .data section.  */
     93  1.7  uebayasi     . = ALIGN(. != 0 ? 32 / 8 : 1);
     94  1.2      matt   }
     95  1.6       mrg   . = ALIGN(32 / 8);
     96  1.6       mrg   . = ALIGN(32 / 8);
     97  1.6       mrg   __end = .;
     98  1.6       mrg   _end = .; PROVIDE (end = .);
     99  1.6       mrg   /* . = DATA_SEGMENT_END (.); */
    100  1.6       mrg   /* Stabs debugging sections.  */
    101  1.6       mrg   .stab          0 : { *(.stab) }
    102  1.6       mrg   .stabstr       0 : { *(.stabstr) }
    103  1.6       mrg   .stab.excl     0 : { *(.stab.excl) }
    104  1.6       mrg   .stab.exclstr  0 : { *(.stab.exclstr) }
    105  1.6       mrg   .stab.index    0 : { *(.stab.index) }
    106  1.6       mrg   .stab.indexstr 0 : { *(.stab.indexstr) }
    107  1.6       mrg   .comment       0 : { *(.comment) }
    108  1.2      matt   /* DWARF debug sections.
    109  1.6       mrg      Symbols in the DWARF debugging sections are relative to the beginning
    110  1.6       mrg      of the section so we begin them at 0.  */
    111  1.6       mrg   /* DWARF 1 */
    112  1.2      matt   .debug          0 : { *(.debug) }
    113  1.6       mrg   .line           0 : { *(.line) }
    114  1.6       mrg   /* GNU DWARF 1 extensions */
    115  1.2      matt   .debug_srcinfo  0 : { *(.debug_srcinfo) }
    116  1.6       mrg   .debug_sfnames  0 : { *(.debug_sfnames) }
    117  1.6       mrg   /* DWARF 1.1 and DWARF 2 */
    118  1.2      matt   .debug_aranges  0 : { *(.debug_aranges) }
    119  1.2      matt   .debug_pubnames 0 : { *(.debug_pubnames) }
    120  1.6       mrg   /* DWARF 2 */
    121  1.6       mrg   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
    122  1.6       mrg   .debug_abbrev   0 : { *(.debug_abbrev) }
    123  1.6       mrg   .debug_line     0 : { *(.debug_line) }
    124  1.6       mrg   .debug_frame    0 : { *(.debug_frame) }
    125  1.6       mrg   .debug_str      0 : { *(.debug_str) }
    126  1.6       mrg   .debug_loc      0 : { *(.debug_loc) }
    127  1.6       mrg   .debug_macinfo  0 : { *(.debug_macinfo) }
    128  1.6       mrg   /* SGI/MIPS DWARF 2 extensions */
    129  1.6       mrg   .debug_weaknames 0 : { *(.debug_weaknames) }
    130  1.6       mrg   .debug_funcnames 0 : { *(.debug_funcnames) }
    131  1.6       mrg   .debug_typenames 0 : { *(.debug_typenames) }
    132  1.6       mrg   .debug_varnames  0 : { *(.debug_varnames) }
    133  1.6       mrg   /* DWARF 3 */
    134  1.6       mrg   .debug_pubtypes 0 : { *(.debug_pubtypes) }
    135  1.6       mrg   .debug_ranges   0 : { *(.debug_ranges) }
    136  1.6       mrg   /* DWARF Extension.  */
    137  1.6       mrg   .debug_macro    0 : { *(.debug_macro) }
    138  1.6       mrg   .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
    139  1.2      matt   .line           0 : { *(.line) }
    140  1.2      matt   /* These must appear regardless of  .  */
    141  1.2      matt   .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
    142  1.2      matt   .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
    143  1.2      matt }
    144