]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/scripttempl/mips.sc
Update year range in copyright notice of binutils files
[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#
250d07de 4# Copyright (C) 2014-2021 Free Software Foundation, Inc.
6c19b93b 5#
985743c7
NC
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
250d07de 27/* Copyright (C) 2014-2021 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 : {
2d3181c7
AM
43 ${RELOCATING+_ftext = .;
44 KEEP (*(SORT_NONE(.init)))
45 eprol = .;}
252b5132 46 *(.text)
2d3181c7
AM
47 ${RELOCATING+KEEP (*(SORT_NONE(.fini)))
48 etext = .;
49 _etext = .;}
252b5132
RH
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