@@ -224,20 +224,16 @@ static bool isRelExpr(RelExpr expr) {
224
224
static bool isStaticLinkTimeConstant (RelExpr e, RelType type, const Symbol &sym,
225
225
InputSectionBase &s, uint64_t relOff) {
226
226
// These expressions always compute a constant
227
- if (oneof<R_DTPREL, R_GOTPLT, R_GOT_OFF, R_TLSLD_GOT_OFF,
228
- R_MIPS_GOT_LOCAL_PAGE, R_MIPS_GOTREL, R_MIPS_GOT_OFF,
229
- R_MIPS_GOT_OFF32, R_MIPS_GOT_GP_PC, R_MIPS_TLSGD,
227
+ if (oneof<R_DTPREL, R_GOTPLT, R_GOT_OFF, R_MIPS_GOT_LOCAL_PAGE, R_MIPS_GOTREL,
228
+ R_MIPS_GOT_OFF, R_MIPS_GOT_OFF32, R_MIPS_GOT_GP_PC,
230
229
R_AARCH64_GOT_PAGE_PC, R_GOT_PC, R_GOTONLY_PC, R_GOTPLTONLY_PC,
231
- R_PLT_PC, R_PLT_GOTPLT, R_TLSGD_GOT, R_TLSGD_GOTPLT, R_TLSGD_PC,
232
- R_PPC32_PLTREL, R_PPC64_CALL_PLT, R_PPC64_RELAX_TOC, R_RISCV_ADD,
233
- R_TLSDESC_CALL, R_TLSDESC_PC, R_TLSDESC_GOTPLT,
234
- R_AARCH64_TLSDESC_PAGE, R_TLSLD_HINT, R_TLSIE_HINT,
235
- R_AARCH64_GOT_PAGE>(e))
230
+ R_PLT_PC, R_PLT_GOTPLT, R_PPC32_PLTREL, R_PPC64_CALL_PLT,
231
+ R_PPC64_RELAX_TOC, R_RISCV_ADD, R_AARCH64_GOT_PAGE>(e))
236
232
return true ;
237
233
238
234
// These never do, except if the entire file is position dependent or if
239
235
// only the low bits are used.
240
- if (e == R_GOT || e == R_PLT || e == R_TLSDESC )
236
+ if (e == R_GOT || e == R_PLT)
241
237
return target->usesOnlyLowPageBits (type) || !config->isPic ;
242
238
243
239
if (sym.isPreemptible )
@@ -1293,7 +1289,10 @@ handleTlsRelocation(RelType type, Symbol &sym, InputSectionBase &c,
1293
1289
if (!sym.isInGot ())
1294
1290
addTpOffsetGotEntry (sym);
1295
1291
// R_GOT may not be a link-time constant.
1296
- processRelocAux<ELFT>(c, expr, type, offset, sym, addend);
1292
+ if (expr == R_GOT)
1293
+ processRelocAux<ELFT>(c, expr, type, offset, sym, addend);
1294
+ else
1295
+ c.relocations .push_back ({expr, type, offset, addend, &sym});
1297
1296
}
1298
1297
return 1 ;
1299
1298
}
0 commit comments