# Linker script for MIPS systems.
|
# Linker script for MIPS systems.
|
# Ian Lance Taylor .
|
# Ian Lance Taylor .
|
# These variables may be overridden by the emulation file. The
|
# These variables may be overridden by the emulation file. The
|
# defaults are appropriate for a DECstation running Ultrix.
|
# defaults are appropriate for a DECstation running Ultrix.
|
test -z "$ENTRY" && ENTRY=__start
|
test -z "$ENTRY" && ENTRY=__start
|
|
|
if [ -z "$EMBEDDED" ]; then
|
if [ -z "$EMBEDDED" ]; then
|
test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000 + SIZEOF_HEADERS"
|
test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000 + SIZEOF_HEADERS"
|
else
|
else
|
test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000"
|
test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000"
|
fi
|
fi
|
if test "x$LD_FLAG" = "xn" -o "x$LD_FLAG" = "xN"; then
|
if test "x$LD_FLAG" = "xn" -o "x$LD_FLAG" = "xN"; then
|
DATA_ADDR=.
|
DATA_ADDR=.
|
else
|
else
|
test -z "$DATA_ADDR" && DATA_ADDR=0x10000000
|
test -z "$DATA_ADDR" && DATA_ADDR=0x10000000
|
fi
|
fi
|
cat <
|
cat <
|
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
|
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
|
"${LITTLE_OUTPUT_FORMAT}")
|
"${LITTLE_OUTPUT_FORMAT}")
|
${LIB_SEARCH_DIRS}
|
${LIB_SEARCH_DIRS}
|
|
|
ENTRY(${ENTRY})
|
ENTRY(${ENTRY})
|
|
|
SECTIONS
|
SECTIONS
|
{
|
{
|
${RELOCATING+. = ${TEXT_START_ADDR};}
|
${RELOCATING+. = ${TEXT_START_ADDR};}
|
.text : {
|
.text : {
|
${RELOCATING+ _ftext = . };
|
${RELOCATING+ _ftext = . };
|
*(.init)
|
*(.init)
|
${RELOCATING+ eprol = .};
|
${RELOCATING+ eprol = .};
|
*(.text)
|
*(.text)
|
*(.fini)
|
*(.fini)
|
${RELOCATING+ etext = .};
|
${RELOCATING+ etext = .};
|
${RELOCATING+ _etext = .};
|
${RELOCATING+ _etext = .};
|
}
|
}
|
${RELOCATING+. = ${DATA_ADDR};}
|
${RELOCATING+. = ${DATA_ADDR};}
|
.rdata : {
|
.rdata : {
|
*(.rdata)
|
*(.rdata)
|
}
|
}
|
${RELOCATING+ _fdata = ALIGN(16);}
|
${RELOCATING+ _fdata = ALIGN(16);}
|
.data : {
|
.data : {
|
*(.data)
|
*(.data)
|
${CONSTRUCTING+CONSTRUCTORS}
|
${CONSTRUCTING+CONSTRUCTORS}
|
}
|
}
|
${RELOCATING+ _gp = ALIGN(16) + 0x8000;}
|
${RELOCATING+ _gp = ALIGN(16) + 0x8000;}
|
.lit8 : {
|
.lit8 : {
|
*(.lit8)
|
*(.lit8)
|
}
|
}
|
.lit4 : {
|
.lit4 : {
|
*(.lit4)
|
*(.lit4)
|
}
|
}
|
.sdata : {
|
.sdata : {
|
*(.sdata)
|
*(.sdata)
|
}
|
}
|
${RELOCATING+ edata = .;}
|
${RELOCATING+ edata = .;}
|
${RELOCATING+ _edata = .;}
|
${RELOCATING+ _edata = .;}
|
${RELOCATING+ _fbss = .;}
|
${RELOCATING+ _fbss = .;}
|
.sbss : {
|
.sbss : {
|
*(.sbss)
|
*(.sbss)
|
*(.scommon)
|
*(.scommon)
|
}
|
}
|
.bss : {
|
.bss : {
|
*(.bss)
|
*(.bss)
|
*(COMMON)
|
*(COMMON)
|
}
|
}
|
${RELOCATING+ end = .;}
|
${RELOCATING+ end = .;}
|
${RELOCATING+ _end = .;}
|
${RELOCATING+ _end = .;}
|
}
|
}
|
EOF
|
EOF
|
|
|