@@ -215,10 +215,10 @@ bool lld::elf::needsGot(RelExpr expr) {
215215// returns false for TLS variables even though then need a captable entry,
216216// because TLS variables use the captable differently than regular variables.
217217static bool needsMipsCheriCapTable (RelExpr expr) {
218- return oneof<R_MIPS_CHERI_CAPTAB_INDEX ,
219- R_MIPS_CHERI_CAPTAB_INDEX_SMALL_IMMEDIATE ,
220- R_MIPS_CHERI_CAPTAB_INDEX_CALL ,
221- R_MIPS_CHERI_CAPTAB_INDEX_CALL_SMALL_IMMEDIATE >(expr);
218+ return oneof<RE_MIPS_CHERI_CAPTAB_INDEX ,
219+ RE_MIPS_CHERI_CAPTAB_INDEX_SMALL_IMMEDIATE ,
220+ RE_MIPS_CHERI_CAPTAB_INDEX_CALL ,
221+ RE_MIPS_CHERI_CAPTAB_INDEX_CALL_SMALL_IMMEDIATE >(expr);
222222}
223223
224224// True if this expression is of the form Sym - X, where X is a position in the
@@ -227,7 +227,7 @@ static bool isRelExpr(RelExpr expr) {
227227 return oneof<R_PC, R_GOTREL, R_GOTPLTREL, RE_ARM_PCA, RE_MIPS_GOTREL,
228228 RE_PPC64_CALL, RE_PPC64_RELAX_TOC, RE_AARCH64_PAGE_PC,
229229 R_RELAX_GOT_PC, RE_RISCV_PC_INDIRECT, RE_PPC64_RELAX_GOT_PC,
230- RE_LOONGARCH_PAGE_PC, R_MIPS_CHERI_CAPTAB_REL >(expr);
230+ RE_LOONGARCH_PAGE_PC, RE_MIPS_CHERI_CAPTAB_REL >(expr);
231231}
232232
233233static RelExpr toPlt (RelExpr expr) {
@@ -1060,21 +1060,22 @@ bool RelocationScanner::isStaticLinkTimeConstant(RelExpr e, RelType type,
10601060 const Symbol &sym,
10611061 uint64_t relOff) const {
10621062 // These expressions always compute a constant
1063- if (oneof<
1064- R_GOTPLT, R_GOT_OFF, R_RELAX_HINT, RE_MIPS_GOT_LOCAL_PAGE,
1065- RE_MIPS_GOTREL, RE_MIPS_GOT_OFF, RE_MIPS_GOT_OFF32, RE_MIPS_GOT_GP_PC,
1066- RE_AARCH64_GOT_PAGE_PC, RE_AARCH64_AUTH_GOT_PAGE_PC, R_GOT_PC,
1067- R_GOTONLY_PC, R_GOTPLTONLY_PC, R_PLT_PC, R_PLT_GOTREL, R_PLT_GOTPLT,
1068- R_GOTPLT_GOTREL, R_GOTPLT_PC, RE_PPC32_PLTREL, RE_PPC64_CALL_PLT,
1069- RE_PPC64_RELAX_TOC, RE_RISCV_ADD, RE_AARCH64_GOT_PAGE,
1070- RE_AARCH64_AUTH_GOT, RE_AARCH64_AUTH_GOT_PC, RE_LOONGARCH_PLT_PAGE_PC,
1071- RE_LOONGARCH_GOT, RE_LOONGARCH_GOT_PAGE_PC, R_MIPS_CHERI_CAPTAB_INDEX,
1072- R_MIPS_CHERI_CAPTAB_INDEX_SMALL_IMMEDIATE,
1073- R_MIPS_CHERI_CAPTAB_INDEX_CALL,
1074- R_MIPS_CHERI_CAPTAB_INDEX_CALL_SMALL_IMMEDIATE,
1075- R_MIPS_CHERI_CAPTAB_REL, R_CHERIOT_COMPARTMENT_CGPREL_HI,
1076- R_CHERIOT_COMPARTMENT_CGPREL_LO_I, R_CHERIOT_COMPARTMENT_CGPREL_LO_S,
1077- R_CHERIOT_COMPARTMENT_SIZE>(e))
1063+ if (oneof<R_GOTPLT, R_GOT_OFF, R_RELAX_HINT, RE_MIPS_GOT_LOCAL_PAGE,
1064+ RE_MIPS_GOTREL, RE_MIPS_GOT_OFF, RE_MIPS_GOT_OFF32,
1065+ RE_MIPS_GOT_GP_PC, RE_AARCH64_GOT_PAGE_PC,
1066+ RE_AARCH64_AUTH_GOT_PAGE_PC, R_GOT_PC, R_GOTONLY_PC,
1067+ R_GOTPLTONLY_PC, R_PLT_PC, R_PLT_GOTREL, R_PLT_GOTPLT,
1068+ R_GOTPLT_GOTREL, R_GOTPLT_PC, RE_PPC32_PLTREL, RE_PPC64_CALL_PLT,
1069+ RE_PPC64_RELAX_TOC, RE_RISCV_ADD, RE_AARCH64_GOT_PAGE,
1070+ RE_AARCH64_AUTH_GOT, RE_AARCH64_AUTH_GOT_PC,
1071+ RE_LOONGARCH_PLT_PAGE_PC, RE_LOONGARCH_GOT,
1072+ RE_LOONGARCH_GOT_PAGE_PC, RE_MIPS_CHERI_CAPTAB_INDEX,
1073+ RE_MIPS_CHERI_CAPTAB_INDEX_SMALL_IMMEDIATE,
1074+ RE_MIPS_CHERI_CAPTAB_INDEX_CALL,
1075+ RE_MIPS_CHERI_CAPTAB_INDEX_CALL_SMALL_IMMEDIATE,
1076+ RE_MIPS_CHERI_CAPTAB_REL, RE_CHERIOT_COMPARTMENT_CGPREL_HI,
1077+ RE_CHERIOT_COMPARTMENT_CGPREL_LO_I,
1078+ RE_CHERIOT_COMPARTMENT_CGPREL_LO_S, RE_CHERIOT_COMPARTMENT_SIZE>(e))
10781079 return true ;
10791080
10801081 // Cheri capability relocations are never static link time constants since
@@ -1418,17 +1419,17 @@ static unsigned handleMipsTlsRelocation(Ctx &ctx, RelType type, Symbol &sym,
14181419 c.addReloc (ctx, {expr, type, offset, addend, &sym});
14191420 return 1 ;
14201421 }
1421- if (expr == R_MIPS_CHERI_CAPTAB_TLSLD ) {
1422+ if (expr == RE_MIPS_CHERI_CAPTAB_TLSLD ) {
14221423 ctx.in .mipsCheriCapTable ->addTlsIndex ();
14231424 c.addReloc (ctx, {expr, type, offset, addend, &sym});
14241425 return 1 ;
14251426 }
1426- if (expr == R_MIPS_CHERI_CAPTAB_TLSGD ) {
1427+ if (expr == RE_MIPS_CHERI_CAPTAB_TLSGD ) {
14271428 ctx.in .mipsCheriCapTable ->addDynTlsEntry (sym);
14281429 c.addReloc (ctx, {expr, type, offset, addend, &sym});
14291430 return 1 ;
14301431 }
1431- if (expr == R_MIPS_CHERI_CAPTAB_TPREL ) {
1432+ if (expr == RE_MIPS_CHERI_CAPTAB_TPREL ) {
14321433 ctx.in .mipsCheriCapTable ->addTlsEntry (sym);
14331434 c.addReloc (ctx, {expr, type, offset, addend, &sym});
14341435 return 1 ;
0 commit comments