Commit | Line | Data |
---|---|---|
465bc359 AM |
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 | |
54530ea4 | 3 | # elf32ebmipvxworks.sh elf32elmipvxworks.sh |
465bc359 | 4 | |
252b5132 RH |
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 | |
465bc359 | 10 | test -n "${EMBEDDED}" || DATA_ADDR=0x10000000 |
24718e3b L |
11 | MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" |
12 | COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" | |
252b5132 | 13 | SHLIB_TEXT_START_ADDR=0x5ffe0000 |
161f49a3 | 14 | TEXT_DYNAMIC= |
5a8e7be2 AM |
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} | |
351cdf24 MF |
20 | .MIPS.abiflags ${RELOCATING-0} : { *(.MIPS.abiflags) } |
21 | .reginfo ${RELOCATING-0} : { *(.reginfo) } | |
465bc359 | 22 | " |
252b5132 | 23 | OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' |
5427f821 RS |
24 | # Unlike most targets, the MIPS backend puts all dynamic relocations |
25 | # in a single dynobj section, which it also calls ".rel.dyn". It does | |
26 | # this so that it can easily sort all dynamic relocations before the | |
27 | # output section has been populated. | |
28 | OTHER_GOT_RELOC_SECTIONS=" | |
29 | .rel.dyn ${RELOCATING-0} : { *(.rel.dyn) } | |
30 | " | |
4e25343c RS |
31 | # If the output has a GOT section, there must be exactly 0x7ff0 bytes |
32 | # between .got and _gp. The ". = ." below stops the orphan code from | |
33 | # inserting other sections between the assignment to _gp and the start | |
34 | # of .got. | |
252b5132 | 35 | OTHER_GOT_SYMBOLS=' |
4e25343c | 36 | . = .; |
9e808284 | 37 | HIDDEN (_gp = ALIGN (16) + 0x7ff0); |
252b5132 | 38 | ' |
861fb55a DJ |
39 | # .got.plt is only used for the PLT psABI extension. It should not be |
40 | # included in the .sdata block with .got, as there is no need to access | |
41 | # the section from _gp. Note that the traditional: | |
42 | # | |
43 | # . = . | |
44 | # _gp = ALIGN (16) + 0x7ff0; | |
45 | # .got : { *(.got.plt) *(.got) } | |
46 | # | |
47 | # would set _gp to the wrong value; _gp - 0x7ff0 must point to the start | |
48 | # of *(.got). | |
49 | GOT=".got ${RELOCATING-0} : { *(.got) }" | |
50 | unset OTHER_READWRITE_SECTIONS | |
51 | unset OTHER_RELRO_SECTIONS | |
52 | if test -n "$RELRO_NOW"; then | |
53 | OTHER_RELRO_SECTIONS=".got.plt ${RELOCATING-0} : { *(.got.plt) }" | |
54 | else | |
55 | OTHER_READWRITE_SECTIONS=".got.plt ${RELOCATING-0} : { *(.got.plt) }" | |
56 | fi | |
57 | ||
465bc359 AM |
58 | OTHER_SDATA_SECTIONS=" |
59 | .lit8 ${RELOCATING-0} : { *(.lit8) } | |
60 | .lit4 ${RELOCATING-0} : { *(.lit4) } | |
61 | " | |
252b5132 RH |
62 | TEXT_START_SYMBOLS='_ftext = . ;' |
63 | DATA_START_SYMBOLS='_fdata = . ;' | |
64 | OTHER_BSS_SYMBOLS='_fbss = .;' | |
65 | OTHER_SECTIONS=' | |
66 | .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } | |
67 | .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } | |
c0a512e2 JM |
68 | .mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) } |
69 | .mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) } | |
70 | .mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) } | |
71 | .mdebug.abiO64 0 : { KEEP(*(.mdebug.abiO64)) } | |
72 | .mdebug.eabi32 0 : { KEEP(*(.mdebug.eabi32)) } | |
73 | .mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) } | |
74 | .gcc_compiled_long32 0 : { KEEP(*(.gcc_compiled_long32)) } | |
75 | .gcc_compiled_long64 0 : { KEEP(*(.gcc_compiled_long64)) } | |
252b5132 RH |
76 | ' |
77 | ARCH=mips | |
78 | MACHINE= | |
79 | TEMPLATE_NAME=elf32 | |
73934d31 | 80 | EXTRA_EM_FILE=mipself |
252b5132 | 81 | GENERATE_SHLIB_SCRIPT=yes |
35eb9fb6 | 82 | GENERATE_PIE_SCRIPT=yes |