Skip to content

Commit 84d879d

Browse files
authored
[RISCV] Rename Relocation QC_E_JUMP_PLT to QC_E_CALL_PLT (#143998)
The semantics and definition of this relocation are unchanged. The new name reflects that instructions with the relocation should be assumed to clobber non-callee-saved registers, as with the R_RISCV_CALL_PLT relocation. The name was changed in v0.2 of the ABI extensions: https://github.com/quic/riscv-elf-psabi-quic-extensions/releases/tag/v0.2
1 parent 2dc58e0 commit 84d879d

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_ABS20_U, 192)
2626
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_E_BRANCH, 193)
2727
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_E_32, 194)
28-
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_E_JUMP_PLT, 195)
28+
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_E_CALL_PLT, 195)

llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ MCFixupKindInfo RISCVAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
8585
{"fixup_riscv_qc_e_branch", 0, 48, MCFixupKindInfo::FKF_IsPCRel},
8686
{"fixup_riscv_qc_e_32", 16, 32, 0},
8787
{"fixup_riscv_qc_abs20_u", 12, 20, 0},
88-
{"fixup_riscv_qc_e_jump_plt", 0, 48, MCFixupKindInfo::FKF_IsPCRel},
88+
{"fixup_riscv_qc_e_call_plt", 0, 48, MCFixupKindInfo::FKF_IsPCRel},
8989
};
9090
static_assert((std::size(Infos)) == RISCV::NumTargetFixupKinds,
9191
"Not all fixup kinds added to Infos array");
@@ -552,7 +552,7 @@ static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
552552
Value = (Bit19 << 31) | (Bit14_0 << 16) | (Bit18_15 << 12);
553553
return Value;
554554
}
555-
case RISCV::fixup_riscv_qc_e_jump_plt: {
555+
case RISCV::fixup_riscv_qc_e_call_plt: {
556556
if (!isInt<32>(Value))
557557
Ctx.reportError(Fixup.getLoc(), "fixup value out of range");
558558
if (Value & 0x1)
@@ -699,7 +699,7 @@ void RISCVAsmBackend::maybeAddVendorReloc(const MCFragment &F,
699699
case RISCV::fixup_riscv_qc_e_branch:
700700
case RISCV::fixup_riscv_qc_abs20_u:
701701
case RISCV::fixup_riscv_qc_e_32:
702-
case RISCV::fixup_riscv_qc_e_jump_plt:
702+
case RISCV::fixup_riscv_qc_e_call_plt:
703703
VendorIdentifier = "QUALCOMM";
704704
break;
705705
}

llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ unsigned RISCVELFObjectWriter::getRelocType(const MCFixup &Fixup,
101101
return ELF::R_RISCV_CALL_PLT;
102102
case RISCV::fixup_riscv_qc_e_branch:
103103
return ELF::R_RISCV_QC_E_BRANCH;
104-
case RISCV::fixup_riscv_qc_e_jump_plt:
105-
return ELF::R_RISCV_QC_E_JUMP_PLT;
104+
case RISCV::fixup_riscv_qc_e_call_plt:
105+
return ELF::R_RISCV_QC_E_CALL_PLT;
106106
}
107107
}
108108

llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ enum Fixups {
5454
// 20-bit fixup for symbol references in the 32-bit qc.li instruction
5555
fixup_riscv_qc_abs20_u,
5656
// 32-bit fixup for symbol references in the 48-bit qc.j/qc.jal instructions
57-
fixup_riscv_qc_e_jump_plt,
57+
fixup_riscv_qc_e_call_plt,
5858

5959
// Used as a sentinel, must be the last
6060
fixup_riscv_invalid,

llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ uint64_t RISCVMCCodeEmitter::getImmOpValue(const MCInst &MI, unsigned OpNo,
645645
FixupKind = RISCV::fixup_riscv_qc_e_32;
646646
RelaxCandidate = true;
647647
} else if (MIFrm == RISCVII::InstFormatQC_EJ) {
648-
FixupKind = RISCV::fixup_riscv_qc_e_jump_plt;
648+
FixupKind = RISCV::fixup_riscv_qc_e_call_plt;
649649
RelaxCandidate = true;
650650
}
651651
}

0 commit comments

Comments
 (0)