shelf32.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Note: this parameter script is sourced by the other
  2. # sh[l]elf(32|64).sh parameter scripts.
  3. SCRIPT_NAME=elf
  4. OUTPUT_FORMAT=${OUTPUT_FORMAT-"elf32-sh64"}
  5. NO_REL_RELOCS=yes
  6. TEXT_START_ADDR=0x1000
  7. MAXPAGESIZE=128
  8. ARCH=sh
  9. MACHINE=sh5
  10. ALIGNMENT=8
  11. TEMPLATE_NAME=elf32
  12. GENERATE_SHLIB_SCRIPT=yes
  13. EMBEDDED=yes
  14. DATA_START_SYMBOLS='PROVIDE (___data = .);'
  15. # If data is located right after .text (not explicitly specified),
  16. # then we need to align it to an 8-byte boundary.
  17. OTHER_READONLY_SECTIONS='
  18. PROVIDE (___rodata = DEFINED (.rodata) ? .rodata : 0);
  19. . = ALIGN (8);
  20. '
  21. # Make _edata and .bss aligned by smuggling in an alignment directive.
  22. OTHER_GOT_SECTIONS='. = ALIGN (8);'
  23. # These are for compatibility with the COFF toolchain.
  24. ENTRY=start
  25. CTOR_START='___ctors = .;'
  26. CTOR_END='___ctors_end = .;'
  27. DTOR_START='___dtors = .;'
  28. DTOR_END='___dtors_end = .;'
  29. # Do not use the varname=${varname-'string'} construct here; there are
  30. # problems with that on some shells (e.g. on Solaris) where there is a bug
  31. # that trigs when $varname contains a "}".
  32. # The effect of the .stack definition is like setting STACK_ADDR to 0x80000,
  33. # except that the setting can be overridden, e.g. --defsym _stack=0xff000,
  34. # and that we put an extra sentinal value at the bottom.
  35. # N.B. We can't use PROVIDE to set the default value in a symbol because
  36. # the address is needed to place the .stack section, which in turn is needed
  37. # to hold the sentinel value(s).
  38. test -z "$CREATE_SHLIB" && OTHER_SECTIONS="
  39. .stack ${RELOCATING-0}${RELOCATING+(DEFINED(_stack) ? _stack : ALIGN (0x40000) + 0x80000)} :
  40. {
  41. ${RELOCATING+_stack = .;}
  42. *(.stack)
  43. LONG(0xdeaddead)
  44. }
  45. .cranges 0 : { *(.cranges) }
  46. "
  47. # We do not need .stack for shared library.
  48. test -n "$CREATE_SHLIB" && OTHER_SECTIONS="
  49. .cranges 0 : { *(.cranges) }
  50. "
  51. # We need to adjust sizes in the .cranges section after relaxation, so
  52. # we need an after_allocation function, and it goes in this file.
  53. EXTRA_EM_FILE=${EXTRA_EM_FILE-sh64elf}