From owner-svn-src-all@FreeBSD.ORG Mon Oct 13 06:07:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7998106568B; Mon, 13 Oct 2008 06:07:58 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C70E28FC2D; Mon, 13 Oct 2008 06:07:58 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9D67wLw065198; Mon, 13 Oct 2008 06:07:58 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9D67wNU065197; Mon, 13 Oct 2008 06:07:58 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200810130607.m9D67wNU065197@svn.freebsd.org> From: Bruce M Simpson Date: Mon, 13 Oct 2008 06:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183815 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 06:07:59 -0000 Author: bms Date: Mon Oct 13 06:07:58 2008 New Revision: 183815 URL: http://svn.freebsd.org/changeset/base/183815 Log: Fix the CFE ldscript after the cutover to tradmips. Diff minimization against ldscript.mips. Note: CFE will not load PT_DYNAMIC segments, therefore the dynamic sections have been placed in a PT_LOAD segment for now. This is not too efficient in terms of memory use, they should probably get placed in the text segment. Modified: head/sys/conf/ldscript.mips.cfe Modified: head/sys/conf/ldscript.mips.cfe ============================================================================== --- head/sys/conf/ldscript.mips.cfe Mon Oct 13 01:11:28 2008 (r183814) +++ head/sys/conf/ldscript.mips.cfe Mon Oct 13 06:07:58 2008 (r183815) @@ -1,9 +1,46 @@ +/*- + * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Juniper Networks, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 + * $FreeBSD$ + */ + /* - * This linker script is needed to build a kernel for use by Broadcom CFE. + * This linker script is needed to build a kernel for use by Broadcom CFE + * when loaded over TFTP; its ELF loader does not support backwards seek + * on network I/O streams. + * Furthermore, CFE will only load PT_LOAD segments, therefore the dynamic + * sections must be placed in their own segment. */ -/* $FreeBSD$ */ -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips") +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", + "elf32-tradlittlemips") + OUTPUT_ARCH(mips) ENTRY(_start) SEARCH_DIR(/usr/lib); @@ -11,23 +48,22 @@ SEARCH_DIR(/usr/lib); __DYNAMIC = 0; PROVIDE (_DYNAMIC = 0); */ -DYNAMIC_LINK = 0; /* XXX */ + +PHDRS +{ + headers PT_PHDR FILEHDR PHDRS ; + interp PT_INTERP ; + text PT_LOAD ; + dynamic PT_LOAD ; + data PT_LOAD ; +} + SECTIONS { /* Read-only sections, merged into text segment: */ - . = 0x80001000; - .text : - { - *(.trap) - *(.text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t.*) - } - .interp : { *(.interp) } - .hash : { *(.hash) } + . = 0x80100000 ; + .interp : { *(.interp) } :interp + .hash : { *(.hash) } :text .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } .gnu.version : { *(.gnu.version) } @@ -141,12 +177,20 @@ SECTIONS } .rel.plt : { *(.rel.plt) } .rela.plt : { *(.rela.plt) } - .init : { KEEP (*(.init)) - } - + } :text =0x1000000 + .text : + { + *(.trap) + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t.*) + } =0x1000000 .fini : { KEEP (*(.fini)) @@ -166,7 +210,7 @@ SECTIONS *(.data.*) *(.gnu.linkonce.d.*) SORT(CONSTRUCTORS) - } + } :data .data1 : { *(.data1) } .eh_frame : { KEEP (*(.eh_frame)) } .gcc_except_table : { *(.gcc_except_table) } @@ -200,7 +244,7 @@ SECTIONS .plt : { *(.plt) } _gp = ALIGN(16) + 0x7ff0; .got : { *(.got.plt) *(.got) } - .dynamic : { *(.dynamic) } + .dynamic : { *(.dynamic) } :dynamic /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */