svn commit: r183815 - head/sys/conf
Bruce M Simpson
bms at FreeBSD.org
Mon Oct 13 06:07:59 UTC 2008
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. */
More information about the svn-src-all
mailing list