Add support for DragonFlyBSD target.
[binutils.git] / ld / scripttempl / mips.sc
blobf53558aba4b81edf319ea5bd1844e712c761375c
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.
5 test -z "$ENTRY" && ENTRY=__start
7 if [ -z "$EMBEDDED" ]; then
8   test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000 + SIZEOF_HEADERS"
9 else
10   test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000"
12 if test "x$LD_FLAG" = "xn" -o "x$LD_FLAG" = "xN"; then
13   DATA_ADDR=.
14 else
15   test -z "$DATA_ADDR" && DATA_ADDR=0x10000000
17 cat <<EOF
18 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
19               "${LITTLE_OUTPUT_FORMAT}")
20 ${LIB_SEARCH_DIRS}
22 ${RELOCATING+ENTRY (${ENTRY})}
24 SECTIONS
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 = .;}
69 EOF