1# Linker script for MIPS systems.
2# Ian Lance Taylor <ian@cygnus.com>.
3# These variables may be overridden by the emulation file.  The
4# defaults are appropriate for a DECstation running Ultrix.
5test -z "$ENTRY" && ENTRY=__start
6
7if [ -z "$EMBEDDED" ]; then
8  test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000 + SIZEOF_HEADERS"
9else
10  test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000"
11fi
12if test "x$LD_FLAG" = "xn" -o "x$LD_FLAG" = "xN"; then
13  DATA_ADDR=.
14else
15  test -z "$DATA_ADDR" && DATA_ADDR=0x10000000
16fi
17cat <<EOF
18OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
19	      "${LITTLE_OUTPUT_FORMAT}")
20${LIB_SEARCH_DIRS}
21
22ENTRY(${ENTRY})
23
24SECTIONS
25{
26  ${RELOCATING+. = ${TEXT_START_ADDR};}
27  .text : {
28    ${RELOCATING+ _ftext = . };
29    *(.init)
30    ${RELOCATING+ eprol  =  .};
31    *(.text)
32    *(.fini)
33    ${RELOCATING+ etext  =  .};
34    ${RELOCATING+ _etext  =  .};
35  }
36  ${RELOCATING+. = ${DATA_ADDR};}
37  .rdata : {
38    *(.rdata)
39  }
40  ${RELOCATING+ _fdata = ALIGN(16);}
41  .data : {
42    *(.data)
43    ${CONSTRUCTING+CONSTRUCTORS}
44  }
45  ${RELOCATING+ _gp = ALIGN(16) + 0x8000;}
46  .lit8 : {
47    *(.lit8)
48  }
49  .lit4 : {
50    *(.lit4)
51  }
52  .sdata : {
53    *(.sdata)
54  }
55  ${RELOCATING+ edata  =  .;}
56  ${RELOCATING+ _edata  =  .;}
57  ${RELOCATING+ _fbss = .;}
58  .sbss : {
59    *(.sbss)
60    *(.scommon)
61  }
62  .bss : {
63    *(.bss)
64    *(COMMON)
65  }
66  ${RELOCATING+ end = .;}
67  ${RELOCATING+ _end = .;}
68}
69EOF
70