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