elf32lriscv-defs.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # This is an ELF platform.
  2. SCRIPT_NAME=elf
  3. ARCH=riscv
  4. NO_REL_RELOCS=yes
  5. TEMPLATE_NAME=elf
  6. EXTRA_EM_FILE=riscvelf
  7. ELFSIZE=32
  8. if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then
  9. case " $EMULATION_LIBPATH " in
  10. *" ${EMULATION_NAME} "*)
  11. NATIVE=yes
  12. ;;
  13. esac
  14. fi
  15. # Enable shared library support for everything except an embedded elf target.
  16. case "$target" in
  17. riscv*-elf)
  18. ;;
  19. *)
  20. GENERATE_SHLIB_SCRIPT=yes
  21. GENERATE_PIE_SCRIPT=yes
  22. ;;
  23. esac
  24. IREL_IN_PLT=
  25. TEXT_START_ADDR=0x10000
  26. MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
  27. COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
  28. DATA_START_SYMBOLS="${CREATE_SHLIB-__DATA_BEGIN__ = .;}"
  29. SDATA_START_SYMBOLS="${CREATE_SHLIB-__SDATA_BEGIN__ = .;}
  30. *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*)"
  31. INITIAL_READONLY_SECTIONS=".interp : { *(.interp) } ${CREATE_PIE-${INITIAL_READONLY_SECTIONS}}"
  32. INITIAL_READONLY_SECTIONS="${RELOCATING+${CREATE_SHLIB-${INITIAL_READONLY_SECTIONS}}}"
  33. # We must cover as much of sdata as possible if it exists. If sdata+bss is
  34. # smaller than 0x1000 then we should start from bss end to cover as much of
  35. # the program as possible. But we can't allow gp to cover any of rodata, as
  36. # the address of variables in rodata may change during relaxation, so we start
  37. # from data in that case.
  38. OTHER_END_SYMBOLS="${CREATE_SHLIB-__BSS_END__ = .;
  39. __global_pointer$ = MIN(__SDATA_BEGIN__ + 0x800,
  40. MAX(__DATA_BEGIN__ + 0x800, __BSS_END__ - 0x800));}"