Skip to content

Commit c54aae4

Browse files
committed
fixup! [RISCV] Support Parsing Nonstandard Relocations
1 parent 5e55cab commit c54aae4

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

llvm/include/llvm/BinaryFormat/ELFRelocs/RISCV_nonstandard.def

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@
1010
#error "ELF_RISCV_NONSTANDARD_RELOC must be defined"
1111
#endif
1212

13-
/*
14-
ELF_RISCV_NONSTANDARD_RELOC(VENDOR, NAME, ID) defines information about
15-
nonstandard relocation codes. This can be used when parsing relocations, or
16-
when printing them, to provide better information.
17-
18-
VENDOR should be the symbol name expected in the associated `R_RISCV_VENDOR`
19-
relocation. NAME and ID work like `ELF_RELOC` but the mapping is not expected
20-
to be 1:1.
21-
22-
The mapping in RISCV.def is 1:1, and should be used when the only information
23-
available is the relocation enum value.
24-
*/
13+
// ELF_RISCV_NONSTANDARD_RELOC(VENDOR, NAME, ID) defines information about
14+
// nonstandard relocation codes. This can be used when parsing relocations, or
15+
// when printing them, to provide better information.
16+
//
17+
// VENDOR should be the symbol name expected in the associated `R_RISCV_VENDOR`
18+
// relocation. NAME and ID work like `ELF_RELOC` but the mapping is not expected
19+
// to be 1:1.
20+
//
21+
// The mapping in RISCV.def is 1:1, and should be used when the only information
22+
// available is the relocation enum value.
2523

26-
/* Qualcomm Nonstandard Relocations */
24+
// Qualcomm Nonstandard Relocations
2725
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_ABS20_U, 192)
2826
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_E_BRANCH, 193)
2927
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_E_32, 194)

llvm/test/MC/RISCV/custom_reloc.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
.reloc ., R_RISCV_VENDOR, VENDOR_NAME
2222
.reloc ., R_RISCV_CUSTOM192, my_foo + 1
2323
addi a0, a0, 0
24-
# CHECK-ASM: [[L1:.L[^:]+]]:
24+
# CHECK-ASM: [[L1:.L[^:]+]]:
2525
# CHECK-ASM-NEXT: .reloc [[L1]], R_RISCV_VENDOR, VENDOR_NAME
2626
# CHECK-ASM-NEXT: [[L2:.L[^:]+]]:
2727
# CHECK-ASM-NEXT: .reloc [[L2]], R_RISCV_CUSTOM192, my_foo+1
2828
# CHECK-ASM-NEXT: mv a0, a0
2929

30-
# CHECK-OBJ: addi a0, a0, 0
30+
# CHECK-OBJ: addi a0, a0, 0
3131
# CHECK-OBJ-NEXT: R_RISCV_VENDOR VENDOR_NAME
3232
# CHECK-OBJ-NEXT: R_RISCV_CUSTOM192 my_foo+0x1
3333

@@ -38,13 +38,13 @@
3838
.reloc ., R_RISCV_VENDOR, QUALCOMM
3939
.reloc ., R_RISCV_QC_ABS20_U, my_bar + 2
4040
addi a1, a1, 0
41-
# CHECK-ASM: [[L3:.L[^:]+]]:
41+
# CHECK-ASM: [[L3:.L[^:]+]]:
4242
# CHECK-ASM-NEXT: .reloc [[L3]], R_RISCV_VENDOR, QUALCOMM
4343
# CHECK-ASM-NEXT: [[L4:.L[^:]+]]:
4444
# CHECK-ASM-NEXT: .reloc [[L4]], R_RISCV_QC_ABS20_U, my_bar+2
4545
# CHECK-ASM-NEXT: mv a1, a1
4646

47-
# CHECK-OBJ: addi a1, a1, 0
47+
# CHECK-OBJ: addi a1, a1, 0
4848
# CHECK-OBJ-NEXT: R_RISCV_VENDOR QUALCOMM
4949
# CHECK-OBJ-NEXT: R_RISCV_CUSTOM192 my_bar+0x2
5050

0 commit comments

Comments
 (0)