1# If you change this file, please also look at files which source this one:
2# elf32b4300.sh elf32bsmip.sh elf32btsmip.sh elf32ebmip.sh elf32lmip.sh
3# elf32ebmipvxworks.sh elf32elmipvxworks.sh
4
5SCRIPT_NAME=elf
6OUTPUT_FORMAT="elf32-bigmips"
7BIG_OUTPUT_FORMAT="elf32-bigmips"
8LITTLE_OUTPUT_FORMAT="elf32-littlemips"
9TEXT_START_ADDR=0x0400000
10test -n "${EMBEDDED}" || DATA_ADDR=0x10000000
11MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
12COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
13SHLIB_TEXT_START_ADDR=0x5ffe0000
14TEXT_DYNAMIC=
15INITIAL_READONLY_SECTIONS=
16if test -z "${CREATE_SHLIB}"; then
17  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp) }"
18fi
19INITIAL_READONLY_SECTIONS="${INITIAL_READONLY_SECTIONS}
20  .MIPS.abiflags ${RELOCATING-0} : { *(.MIPS.abiflags) }
21  .reginfo       ${RELOCATING-0} : { *(.reginfo) }
22  .MIPS.xhash    ${RELOCATING-0} : { *(.MIPS.xhash) }
23"
24OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
25# Unlike most targets, the MIPS backend puts all dynamic relocations
26# in a single dynobj section, which it also calls ".rel.dyn".  It does
27# this so that it can easily sort all dynamic relocations before the
28# output section has been populated.
29OTHER_GOT_RELOC_SECTIONS="
30  .rel.dyn      ${RELOCATING-0} : { *(.rel.dyn) }
31"
32# If the output has a GOT section, there must be exactly 0x7ff0 bytes
33# between .got and _gp.
34OTHER_GOT_SYMBOLS='HIDDEN (_gp = ALIGN (16) + 0x7ff0);'
35
36# .got.plt is only used for the PLT psABI extension.  It should not be
37# included in the .sdata block with .got, as there is no need to access
38# the section from _gp.  Note that the traditional:
39#
40#      . = .
41#      _gp = ALIGN (16) + 0x7ff0;
42#      .got : { *(.got.plt) *(.got) }
43#
44# would set _gp to the wrong value; _gp - 0x7ff0 must point to the start
45# of *(.got).
46GOT=".got          ${RELOCATING-0} : { *(.got) }"
47unset OTHER_READWRITE_SECTIONS
48unset OTHER_RELRO_SECTIONS
49if test -n "$RELRO_NOW"; then
50  OTHER_RELRO_SECTIONS=".got.plt      ${RELOCATING-0} : { *(.got.plt) }"
51else
52  OTHER_READWRITE_SECTIONS=".got.plt      ${RELOCATING-0} : { *(.got.plt) }"
53fi
54
55OTHER_SDATA_SECTIONS="
56  .lit8         ${RELOCATING-0} : { *(.lit8) }
57  .lit4         ${RELOCATING-0} : { *(.lit4) }
58"
59TEXT_START_SYMBOLS="PROVIDE_HIDDEN (__eprol = .); ${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};"
60DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};"
61OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};"
62OTHER_SECTIONS="
63  .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
64  .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
65  .mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) }
66  .mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) }
67  .mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) }
68  .mdebug.abiO64 0 : { KEEP(*(.mdebug.abiO64)) }
69  .mdebug.eabi32 0 : { KEEP(*(.mdebug.eabi32)) }
70  .mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) }
71  .gcc_compiled_long32 0 : { KEEP(*(.gcc_compiled_long32)) }
72  .gcc_compiled_long64 0 : { KEEP(*(.gcc_compiled_long64)) }
73"
74ARCH=mips
75MACHINE=
76TEMPLATE_NAME=elf
77EXTRA_EM_FILE=mipself
78GENERATE_SHLIB_SCRIPT=yes
79GENERATE_PIE_SCRIPT=yes
80