summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r--lld/ELF/Writer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index b4d5ec2fb8b..8c4503eed3f 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -478,12 +478,13 @@ template <class ELFT> void OutputSection<ELFT>::writeTo(uint8_t *Buf) {
if (!Body)
continue;
// Skip unsupported for now.
- if (!isa<DefinedRegular<ELFT>>(Body))
+ auto *DR = dyn_cast<DefinedRegular<ELFT>>(Body);
+ if (!DR)
continue;
uintX_t Offset = RI.r_offset;
uint32_t Type = RI.getType(EObj->isMips64EL());
uintX_t P = this->getVA() + C->getOutputSectionOff();
- uintX_t SymVA = getSymVA<ELFT>(cast<DefinedRegular<ELFT>>(Body));
+ uintX_t SymVA = getSymVA<ELFT>(DR);
uint8_t *Location = Base + Offset;
switch (Type) {
case llvm::ELF::R_X86_64_PC32:
OpenPOWER on IntegriCloud