NetBSD/sys/arch/mipsco/conf/stand.ldscript
wdk 513cc0ca27 Linker script for building first stage bootstrap. Due to bugs/limitations
in the MIPS prom loader we have to be very careful how the sections are
ordered and the number of sections defined.   For this reason the standard
linker scripts cannot be used.

The exact rules don't appear to be documented and a little experimentation
is required.
2000-09-18 11:48:29 +00:00

53 lines
1.1 KiB
Plaintext

/* $NetBSD: stand.ldscript,v 1.1 2000/09/18 11:48:29 wdk Exp $ */
/* ldscript for NetBSD/mipsco standalone bootstraps */
OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips")
OUTPUT_ARCH(mips)
ENTRY(_start)
SECTIONS
{
/* Read-only sections, merged into text segment. Assumes the
kernel Makefile sets the start address via -Ttext. */
.text :
{
_ftext = . ;
*(.text)
*(.gnu.warning)
} =0
_etext = .;
PROVIDE (etext = .);
.rodata : { *(.rodata) }
.data :
{
_fdata = . ;
*(.data)
CONSTRUCTORS
}
_gp = ALIGN(16);
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
.sdata : { *(.sdata) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
_fbss = .;
.bss :
{
*(.bss)
*(COMMON)
*(.sbss)
*(.scommon)
}
_end = . ;
PROVIDE (end = .);
/*
* Depending on the nuber of sections and their relative position
* the Mips PROM firmware incorrectly loads the image into memory
* 8 bytes higher then expected. If this happens change the following
* definition from .reginfo to /DISCARD/ to remove the section
*/
.reginfo : { *(.reginfo) }
}