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    ${RELOCATING+PROVIDE (__runtime_reloc_start = .);}
33    *(.rel.sdata)
34    ${RELOCATING+PROVIDE (__runtime_reloc_stop = .);}
35    *(.fini)
36    ${RELOCATING+ etext  =  .};
37    ${RELOCATING+ _etext  =  .};
38  }
39  ${RELOCATING+. = ${DATA_ADDR};}
40  .rdata : {
41    *(.rdata)
42  }
43  ${RELOCATING+ _fdata = ALIGN(16);}
44  .data : {
45    *(.data)
46    ${CONSTRUCTING+CONSTRUCTORS}
47  }
48  ${RELOCATING+ _gp = ALIGN(16) + 0x8000;}
49  .lit8 : {
50    *(.lit8)
51  }
52  .lit4 : {
53    *(.lit4)
54  }
55  .sdata : {
56    *(.sdata)
57  }
58  ${RELOCATING+ edata  =  .;}
59  ${RELOCATING+ _edata  =  .;}
60  ${RELOCATING+ _fbss = .;}
61  .sbss : {
62    *(.sbss)
63    *(.scommon)
64  }
65  .bss : {
66    *(.bss)
67    *(COMMON)
68  }
69  ${RELOCATING+ end = .;}
70  ${RELOCATING+ _end = .;}
71}
72EOF
73