Skip to content

Commit ec7a509

Browse files
committed
ELFObjectWriter: Simplify R_PPC64_TOC special case. NFC
1 parent bb8e2a8 commit ec7a509

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/MC/ELFObjectWriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,6 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm,
13781378
Addend += FixupOffset - Asm.getSymbolOffset(SymB);
13791379
}
13801380

1381-
auto EMachine = TargetObjectWriter->getEMachine();
13821381
unsigned Type;
13831382
if (mc::isRelocRelocation(Fixup.getKind()))
13841383
Type = Fixup.getKind() - FirstLiteralRelocationKind;
@@ -1404,7 +1403,8 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm,
14041403
} else {
14051404
// In PPC64 ELFv1, .quad .TOC.@tocbase in the .opd section is expected to
14061405
// reference the null symbol.
1407-
if (Type == ELF::R_PPC64_TOC && EMachine == ELF::EM_PPC64)
1406+
if (Type == ELF::R_PPC64_TOC &&
1407+
TargetObjectWriter->getEMachine() == ELF::EM_PPC64)
14081408
SymA = nullptr;
14091409

14101410
if (SymA) {

0 commit comments

Comments
 (0)