]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/binutils/ld/scripttempl/mips.sc
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / binutils / ld / scripttempl / mips.sc
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
6
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"
11 fi
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
16 fi
17 cat <<EOF
18 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
19               "${LITTLE_OUTPUT_FORMAT}")
20 ${LIB_SEARCH_DIRS}
21
22 ENTRY(${ENTRY})
23
24 SECTIONS
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 }
69 EOF