GNU Linux-libre 6.7.9-gnu
[releases.git] / arch / riscv / kernel / tests / module_test / test_uleb128.S
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2023 Rivos Inc.
4  */
5
6 .text
7 .global test_uleb_basic
8 test_uleb_basic:
9         lw      a0, second
10         addi    a0, a0, -127
11         ret
12
13 .global test_uleb_large
14 test_uleb_large:
15         lw      a0, fourth
16         addi    a0, a0, -0x07e8
17         ret
18
19 .data
20 first:
21         .space 127
22 second:
23         .reloc second, R_RISCV_SET_ULEB128, second
24         .reloc second, R_RISCV_SUB_ULEB128, first
25         .word 0
26 third:
27         .space 1000
28 fourth:
29         .reloc fourth, R_RISCV_SET_ULEB128, fourth
30         .reloc fourth, R_RISCV_SUB_ULEB128, third
31         .word 0