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