test_uleb128.S 504 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2023 Rivos Inc.
  4. */
  5. .text
  6. .global test_uleb_basic
  7. test_uleb_basic:
  8. lw a0, second
  9. addi a0, a0, -127
  10. ret
  11. .global test_uleb_large
  12. test_uleb_large:
  13. lw a0, fourth
  14. addi a0, a0, -0x07e8
  15. ret
  16. .data
  17. first:
  18. .space 127
  19. second:
  20. .reloc second, R_RISCV_SET_ULEB128, second
  21. .reloc second, R_RISCV_SUB_ULEB128, first
  22. .word 0
  23. third:
  24. .space 1000
  25. fourth:
  26. .reloc fourth, R_RISCV_SET_ULEB128, fourth
  27. .reloc fourth, R_RISCV_SUB_ULEB128, third
  28. .word 0