[VE] Support R_VE_RELATIVE

Change getELFRelativeRelocationType() to return R_VE_RELATIVE
as a preparation of lld for VE.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D115592
This commit is contained in:
Kazushi (Jam) Marukawa 2021-12-12 12:51:44 +09:00
parent 2e585dd91a
commit d1057f9604
2 changed files with 3 additions and 1 deletions

View File

@ -210,6 +210,8 @@ uint32_t llvm::object::getELFRelativeRelocationType(uint32_t Machine) {
return ELF::R_SPARC_RELATIVE;
case ELF::EM_CSKY:
return ELF::R_CKCORE_RELATIVE;
case ELF::EM_VE:
return ELF::R_VE_RELATIVE;
case ELF::EM_AMDGPU:
break;
case ELF::EM_BPF:

View File

@ -53,7 +53,7 @@ TEST(ELFTest, getELFRelocationTypeNameForVE) {
}
TEST(ELFTest, getELFRelativeRelocationType) {
EXPECT_EQ(0U, getELFRelativeRelocationType(EM_VE));
EXPECT_EQ(ELF::R_VE_RELATIVE, getELFRelativeRelocationType(EM_VE));
}
// This is a test for the DataRegion helper struct, defined in ELF.h header.