1/* $NetBSD: kern.ldscript,v 1.9 2015/08/24 08:13:07 uebayasi Exp $ */ 2 3/* ldscript for NetBSD/powerpc kernels and LKMs, based on elf32ppc.x */ 4OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", 5 "elf32-powerpc") 6OUTPUT_ARCH(powerpc:common) 7ENTRY(_start) 8/* Do we need any of these? 9 __DYNAMIC = 0; */ 10_DYNAMIC_LINK = 0; 11SECTIONS 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} 100