elf32bmip.sh 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. SCRIPT_NAME=elf
  5. OUTPUT_FORMAT="elf32-bigmips"
  6. BIG_OUTPUT_FORMAT="elf32-bigmips"
  7. LITTLE_OUTPUT_FORMAT="elf32-littlemips"
  8. TEXT_START_ADDR=0x0400000
  9. test -n "${EMBEDDED}" || DATA_ADDR=0x10000000
  10. MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
  11. COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
  12. SHLIB_TEXT_START_ADDR=0x5ffe0000
  13. TEXT_DYNAMIC=
  14. INITIAL_READONLY_SECTIONS=
  15. if test -z "${CREATE_SHLIB}"; then
  16. INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
  17. fi
  18. INITIAL_READONLY_SECTIONS="${INITIAL_READONLY_SECTIONS}
  19. .MIPS.abiflags ${RELOCATING-0} : { *(.MIPS.abiflags) }
  20. .reginfo ${RELOCATING-0} : { *(.reginfo) }
  21. .MIPS.xhash ${RELOCATING-0} : { *(.MIPS.xhash) }
  22. "
  23. OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
  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. "
  31. # If the output has a GOT section, there must be exactly 0x7ff0 bytes
  32. # between .got and _gp.
  33. OTHER_GOT_SYMBOLS='HIDDEN (_gp = ALIGN (16) + 0x7ff0);'
  34. # .got.plt is only used for the PLT psABI extension. It should not be
  35. # included in the .sdata block with .got, as there is no need to access
  36. # the section from _gp. Note that the traditional:
  37. #
  38. # . = .
  39. # _gp = ALIGN (16) + 0x7ff0;
  40. # .got : { *(.got.plt) *(.got) }
  41. #
  42. # would set _gp to the wrong value; _gp - 0x7ff0 must point to the start
  43. # of *(.got).
  44. GOT=".got ${RELOCATING-0} : { *(.got) }"
  45. unset OTHER_READWRITE_SECTIONS
  46. unset OTHER_RELRO_SECTIONS
  47. if test -n "$RELRO_NOW"; then
  48. OTHER_RELRO_SECTIONS=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
  49. else
  50. OTHER_READWRITE_SECTIONS=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
  51. fi
  52. OTHER_SDATA_SECTIONS="
  53. .lit8 ${RELOCATING-0} : { *(.lit8) }
  54. .lit4 ${RELOCATING-0} : { *(.lit4) }
  55. "
  56. TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};"
  57. DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};"
  58. OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};"
  59. OTHER_SECTIONS="
  60. .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
  61. .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
  62. .mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) }
  63. .mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) }
  64. .mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) }
  65. .mdebug.abiO64 0 : { KEEP(*(.mdebug.abiO64)) }
  66. .mdebug.eabi32 0 : { KEEP(*(.mdebug.eabi32)) }
  67. .mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) }
  68. .gcc_compiled_long32 0 : { KEEP(*(.gcc_compiled_long32)) }
  69. .gcc_compiled_long64 0 : { KEEP(*(.gcc_compiled_long64)) }
  70. "
  71. ARCH=mips
  72. MACHINE=
  73. TEMPLATE_NAME=elf
  74. EXTRA_EM_FILE=mipself
  75. GENERATE_SHLIB_SCRIPT=yes
  76. GENERATE_PIE_SCRIPT=yes