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