criself.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # This is for embedded products (no MMU) with ELF.
  2. MACHINE=
  3. SCRIPT_NAME=elf
  4. TEMPLATE_NAME=elf32
  5. # Symbols have underscore prepended.
  6. OUTPUT_FORMAT="elf32-us-cris"
  7. NO_REL_RELOCS=yes
  8. ARCH=cris
  9. MAXPAGESIZE=32
  10. ENTRY=__start
  11. EMBEDDED=yes
  12. ALIGNMENT=32
  13. TEXT_START_ADDR=0
  14. # Put crt0 for flash/eprom etc. in this section.
  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. .startup : { KEEP(*(.startup)) }"
  21. # Setting __Stext to . in TEXT_START_SYMBOLS doesn't get what we want
  22. # most of the time, which is the start of all read-only sections;
  23. # there's at least .startup and .init before it. We have to resort to
  24. # trickery. Note that __Stext is always defined, not PROVIDE:d, since
  25. # external tools look for it.
  26. TEXT_START_SYMBOLS='__Stext = ADDR (.startup);'
  27. # The __start dance is to get us through assumptions about entry
  28. # symbols, and to clear _start for normal use with sane programs.
  29. EXECUTABLE_SYMBOLS='
  30. __start = DEFINED(__start) ? __start :
  31. DEFINED(_start) ? _start :
  32. DEFINED(start) ? start :
  33. DEFINED(.startup) ? .startup + 2 : 2;
  34. '
  35. # Smuggle an "OTHER_TEXT_END_SYMBOLS" here.
  36. OTHER_READONLY_SECTIONS="${RELOCATING+PROVIDE (__Etext = .);}"
  37. DATA_START_SYMBOLS='PROVIDE (__Sdata = .);'
  38. # Smuggle an "OTHER_DATA_END_SYMBOLS" here.
  39. OTHER_SDATA_SECTIONS="${RELOCATING+PROVIDE (__Edata = .);}"
  40. # If .bss does not immediately follow .data but has its own start
  41. # address, we can't get to it with OTHER_BSS_SYMBOLS, neither can we
  42. # use ADDR(.bss) there. Instead, we use the symbol support for the
  43. # end symbol.
  44. OTHER_BSS_END_SYMBOLS='
  45. PROVIDE (__Ebss = .);
  46. __Sbss = ADDR (.bss);
  47. PROVIDE (_bss_start = __Sbss);
  48. '
  49. OTHER_END_SYMBOLS='PROVIDE (__end = .);'
  50. INIT_ADDR='ALIGN (2)'
  51. INIT_START='
  52. ___init__start = .;
  53. PROVIDE (___do_global_ctors = .);
  54. '
  55. INIT_END='
  56. PROVIDE (__init__end = .);
  57. PROVIDE (___init__end = .);
  58. '
  59. FINI_ADDR='ALIGN (2)'
  60. FINI_START='
  61. ___fini__start = .;
  62. PROVIDE (___do_global_dtors = .);
  63. '
  64. FINI_END='
  65. PROVIDE (__fini__end = .);
  66. ___fini__end = .;
  67. '
  68. CTOR_START='
  69. PROVIDE (___ctors = .);
  70. ___elf_ctors_dtors_begin = .;
  71. '
  72. CTOR_END='
  73. PROVIDE (___ctors_end = .);
  74. '
  75. DTOR_START='
  76. PROVIDE (___dtors = .);
  77. '
  78. CTOR_END='
  79. PROVIDE (___dtors_end = .);
  80. ___elf_ctors_dtors_end = .;
  81. '
  82. # Also add the other symbols provided for rsim/xsim and elinux.
  83. OTHER_SYMBOLS='
  84. PROVIDE (__Eall = .);
  85. PROVIDE (__Endmem = 0x10000000);
  86. PROVIDE (__Stacksize = 0);
  87. '
  88. NO_SMALL_DATA=yes