Module Name: src Committed By: mrg Date: Sun Jan 19 02:32:21 UTC 2014
Modified Files: src/sys/arch/powerpc/conf: kern.ldscript Log Message: make this look more like the latest elf32ppc.x. tested on pegasosII. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/conf/kern.ldscript Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/powerpc/conf/kern.ldscript diff -u src/sys/arch/powerpc/conf/kern.ldscript:1.5 src/sys/arch/powerpc/conf/kern.ldscript:1.6 --- src/sys/arch/powerpc/conf/kern.ldscript:1.5 Sat Nov 16 12:00:21 2013 +++ src/sys/arch/powerpc/conf/kern.ldscript Sun Jan 19 02:32:21 2014 @@ -1,7 +1,9 @@ -/* $NetBSD: kern.ldscript,v 1.5 2013/11/16 12:00:21 mrg Exp $ */ +/* $NetBSD: kern.ldscript,v 1.6 2014/01/19 02:32:21 mrg Exp $ */ -/* ldscript for NetBSD/powerpc kernels and LKMs */ -OUTPUT_ARCH(powerpc) +/* ldscript for NetBSD/powerpc kernels and LKMs, based on elf32ppc.x */ +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", + "elf32-powerpc") +OUTPUT_ARCH(powerpc:common) ENTRY(_start) SEARCH_DIR(/lib); /* Do we need any of these? @@ -14,29 +16,45 @@ SECTIONS .text : { _ftext = . ; + PROVIDE_HIDDEN (__eprol = .); *(.text) - *(.text.startup) - *(.text.unlikely) + *(.text.unlikely .text.*_unlikely) + *(.text.exit .text.exit.*) + *(.text.startup .text.startup.*) + *(.text.hot .text.hot.*) + *(.text.* .gnu.linkonce.t.*) __stub_start = .; *(.stub) __stub_end = .; __stub_pmap_start = .; *(.stub.pmap) __stub_pmap_end = .; + /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) + *(.glink) } =0 _etext = .; + PROVIDE (__etext = .); + PROVIDE (_etext = .); PROVIDE (etext = .); - .rodata : { *(.rodata) *(.rodata.*) } + .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } + .sdata2 : + { + PROVIDE (_SDA2_BASE_ = 32768); + *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) + } + .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } + /*.jcr : { KEEP (*(.jcr)) } */ /* XXX??? */ .reginfo : { *(.reginfo) } /* . = . + 0x1000; */ - .data : + .data : { _fdata = . ; - *(.data) - CONSTRUCTORS + *(.data .data.* .gnu.linkonce.d.*) + SORT(CONSTRUCTORS) } - .data1 : { *(.data1) } + .data1 : { *(.data1) } . = ALIGN(32); /* COHERENCY UNIT */ .data.cacheline_aligned : { *(.data.cacheline_aligned) } . = ALIGN(32); /* COHERENCY UNIT */ @@ -45,32 +63,79 @@ SECTIONS _gp = ALIGN(16) + 0x7ff0; .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } - .sdata : { *(.sdata) } - _edata = .; - PROVIDE (edata = .); + .sdata : + { + PROVIDE (_SDA_BASE_ = 32768); + *(.sdata .sdata.* .gnu.linkonce.s.*) + } + _edata = .; PROVIDE (edata = .); + . = .; __bss_start = .; _fbss = .; - .sbss : { *(.sbss) *(.scommon) } - .bss : + .sbss : { - *(.bss) + PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .); + *(.dynsbss) + *(.sbss .sbss.* .gnu.linkonce.sb.*) + *(.scommon) + PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); + } + .bss : + { + *(.dynbss) + *(.bss .bss.* .gnu.linkonce.b.*) *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. + FIXME: Why do we need it? When there is no .bss section, we don't + pad the .data section. */ + . = ALIGN(. != 0 ? 32 / 8 : 1); } - _end = . ; - PROVIDE (end = .); - /* These are needed for ELF backends which have not yet been - converted to the new style linker. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } + . = ALIGN(32 / 8); + . = ALIGN(32 / 8); + __end = .; + _end = .; PROVIDE (end = .); + /* . = DATA_SEGMENT_END (.); */ + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } /* DWARF debug sections. - Symbols in the .debug DWARF section are relative to the beginning of the - section so we begin .debug at 0. It's not clear yet what needs to happen - for the others. */ + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ .debug_aranges 0 : { *(.debug_aranges) } .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* DWARF 3 */ + .debug_pubtypes 0 : { *(.debug_pubtypes) } + .debug_ranges 0 : { *(.debug_ranges) } + /* DWARF Extension. */ + .debug_macro 0 : { *(.debug_macro) } + .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } .line 0 : { *(.line) } /* These must appear regardless of . */ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }