]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/scripttempl/mips.sc
Copyright update for binutils
[thirdparty/binutils-gdb.git] / ld / scripttempl / mips.sc
CommitLineData
252b5132
RH
1# Linker script for MIPS systems.
2# Ian Lance Taylor <ian@cygnus.com>.
985743c7 3#
6f2750fe 4# Copyright (C) 2014-2016 Free Software Foundation, Inc.
985743c7
NC
5#
6# Copying and distribution of this file, with or without modification,
7# are permitted in any medium without royalty provided the copyright
8# notice and this notice are preserved.
9#
252b5132
RH
10# These variables may be overridden by the emulation file. The
11# defaults are appropriate for a DECstation running Ultrix.
985743c7 12
252b5132
RH
13test -z "$ENTRY" && ENTRY=__start
14
15if [ -z "$EMBEDDED" ]; then
16 test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000 + SIZEOF_HEADERS"
17else
18 test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000"
19fi
20if test "x$LD_FLAG" = "xn" -o "x$LD_FLAG" = "xN"; then
21 DATA_ADDR=.
22else
23 test -z "$DATA_ADDR" && DATA_ADDR=0x10000000
24fi
985743c7 25
252b5132 26cat <<EOF
6f2750fe 27/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
985743c7
NC
28
29 Copying and distribution of this script, with or without modification,
30 are permitted in any medium without royalty provided the copyright
31 notice and this notice are preserved. */
32
252b5132
RH
33OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
34 "${LITTLE_OUTPUT_FORMAT}")
35${LIB_SEARCH_DIRS}
36
596d6d91 37${RELOCATING+ENTRY (${ENTRY})}
252b5132
RH
38
39SECTIONS
40{
41 ${RELOCATING+. = ${TEXT_START_ADDR};}
42 .text : {
43 ${RELOCATING+ _ftext = . };
44 *(.init)
45 ${RELOCATING+ eprol = .};
46 *(.text)
252b5132
RH
47 *(.fini)
48 ${RELOCATING+ etext = .};
49 ${RELOCATING+ _etext = .};
50 }
51 ${RELOCATING+. = ${DATA_ADDR};}
52 .rdata : {
53 *(.rdata)
54 }
55 ${RELOCATING+ _fdata = ALIGN(16);}
56 .data : {
57 *(.data)
58 ${CONSTRUCTING+CONSTRUCTORS}
59 }
9e808284 60 ${RELOCATING+ HIDDEN (_gp = ALIGN (16) + 0x8000);}
252b5132
RH
61 .lit8 : {
62 *(.lit8)
63 }
64 .lit4 : {
65 *(.lit4)
66 }
67 .sdata : {
68 *(.sdata)
69 }
70 ${RELOCATING+ edata = .;}
71 ${RELOCATING+ _edata = .;}
72 ${RELOCATING+ _fbss = .;}
73 .sbss : {
74 *(.sbss)
75 *(.scommon)
76 }
77 .bss : {
78 *(.bss)
79 *(COMMON)
80 }
81 ${RELOCATING+ end = .;}
82 ${RELOCATING+ _end = .;}
83}
84EOF