Skip to content

Commit 3c5bfe1

Browse files
jrtc27resistor
authored andcommitted
[BinaryFormat][RISCV] Reserve R_RISCV_FUNC_RELATIVE
For non-c18n runtimes this is the same as R_RISCV_RELATIVE, but for c18n runtimes this marks addresses that must not be wrapped in a trampoline as they must point directly to the code in question.
1 parent ae309b6 commit 3c5bfe1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

llvm/include/llvm/BinaryFormat/ELFRelocs/RISCV.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ ELF_RELOC(R_RISCV_TLSDESC_CALL, 65)
6363
ELF_RELOC(R_RISCV_VENDOR, 191)
6464
// ELF_RELOC(R_RISCV_CUSTOM192, 192)
6565
// ELF_RELOC(R_RISCV_CUSTOM193, 193)
66-
ELF_RELOC(R_RISCV_CUSTOM194, 194)
66+
// ELF_RELOC(R_RISCV_CUSTOM194, 194)
6767
ELF_RELOC(R_RISCV_CUSTOM195, 195)
6868
// ELF_RELOC(R_RISCV_CUSTOM196, 196)
6969
// ELF_RELOC(R_RISCV_CUSTOM197, 197)
@@ -129,7 +129,7 @@ ELF_RELOC(R_RISCV_CUSTOM255, 255)
129129
// CHERI relocations
130130
ELF_RELOC(R_RISCV_CHERI_CAPTAB_PCREL_HI20, 192)
131131
ELF_RELOC(R_RISCV_CHERI_CAPABILITY, 193)
132-
// 194 reserved
132+
ELF_RELOC(R_RISCV_FUNC_RELATIVE, 194)
133133
// 195 reserved
134134
ELF_RELOC(R_RISCV_CHERI_TPREL_CINCOFFSET, 196) // Deprecated
135135
ELF_RELOC(R_RISCV_CHERI_TLS_IE_CAPTAB_PCREL_HI20, 197) // Deprecated

llvm/test/MC/RISCV/xqcili-relocations.s

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ qc.li a0, %qc.abs20(undef)
2828
# ASM: qc.e.li s0, undef
2929
# OBJ-NEXT: qc.e.li s0, 0x0
3030
# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}
31-
# OBJ-NEXT: R_RISCV_CUSTOM194 undef{{$}}
31+
# OBJ-NEXT: R_RISCV_FUNC_RELATIVE undef{{$}}
3232
qc.e.li s0, undef
3333

3434

@@ -50,7 +50,7 @@ qc.li a2, %qc.abs20(same_section)
5050
# ASM: qc.e.li s2, same_section
5151
# OBJ-NEXT: qc.e.li s2, 0x0
5252
# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}
53-
# OBJ-NEXT: R_RISCV_CUSTOM194 same_section{{$}}
53+
# OBJ-NEXT: R_RISCV_FUNC_RELATIVE same_section{{$}}
5454
qc.e.li s2, same_section
5555

5656
# ASM: qc.li a3, %qc.abs20(other_section)
@@ -62,7 +62,7 @@ qc.li a3, %qc.abs20(other_section)
6262
# ASM: qc.e.li s3, other_section
6363
# OBJ-NEXT: qc.e.li s3, 0x0
6464
# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}
65-
# OBJ-NEXT: R_RISCV_CUSTOM194 other_section{{$}}
65+
# OBJ-NEXT: R_RISCV_FUNC_RELATIVE other_section{{$}}
6666
qc.e.li s3, other_section
6767

6868
# ASM-LABEL: same_section:
@@ -93,7 +93,7 @@ qc.li a1, %qc.abs20(undef)
9393
# ASM: qc.e.li s1, undef
9494
# OBJ-NEXT: qc.e.li s1, 0x0
9595
# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}
96-
# OBJ-NEXT: R_RISCV_CUSTOM194 undef{{$}}
96+
# OBJ-NEXT: R_RISCV_FUNC_RELATIVE undef{{$}}
9797
# OBJ-NEXT: R_RISCV_RELAX
9898
qc.e.li s1, undef
9999

@@ -110,7 +110,7 @@ qc.li a1, %qc.abs20(undef)
110110
# ASM: qc.e.li a2, undef
111111
# OBJ-NEXT: qc.e.li a2, 0x0
112112
# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}
113-
# OBJ-NEXT: R_RISCV_CUSTOM194 undef{{$}}
113+
# OBJ-NEXT: R_RISCV_FUNC_RELATIVE undef{{$}}
114114
# OBJ-NEXT: R_RISCV_RELAX
115115
qc.e.li a2, undef
116116

0 commit comments

Comments
 (0)