This lets Writer.cpp know that they are got relative, which will allow
further simplifications.
llvm-svn: 267613
switch (Type) {
default:
return R_ABS;
+ case R_MIPS_GPREL16:
+ case R_MIPS_GPREL32:
+ return R_GOTREL;
case R_MIPS_26:
return R_PLT;
case R_MIPS_HI16:
writeMipsLo16<E>(Loc, Val);
break;
case R_MIPS_GPREL16: {
- int64_t V = Val - getMipsGpAddr<ELFT>();
+ int64_t V = Val - MipsGPOffset;
checkInt<16>(V, Type);
writeMipsLo16<E>(Loc, V);
break;
}
case R_MIPS_GPREL32:
- write32<E>(Loc, Val - getMipsGpAddr<ELFT>());
+ write32<E>(Loc, Val - MipsGPOffset);
break;
case R_MIPS_HI16:
writeMipsHi16<E>(Loc, Val);
if (!Config->Pic || Target->isRelRelative(Type) || Expr == R_PC ||
Expr == R_SIZE || isAbsolute<ELFT>(Body)) {
if (Config->EMachine == EM_MIPS && Body.isLocal() &&
- (Type == R_MIPS_GPREL16 || Type == R_MIPS_GPREL32)) {
- Expr = R_ABS;
+ (Type == R_MIPS_GPREL16 || Type == R_MIPS_GPREL32))
Addend += File.getMipsGp0();
- }
C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
continue;
}