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