summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
index 122b5405b86..22cdede640f 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
@@ -377,11 +377,11 @@ void Util::processDefinedAtoms(const lld::File &atomFile) {
}
void Util::processAtomAttributes(const DefinedAtom *atom) {
- auto *machoFile = static_cast<const mach_o::MachOFile *>(&atom->file());
// If the file doesn't use subsections via symbols, then make sure we don't
// add that flag to the final output file if we have a relocatable file.
- if (!machoFile->subsectionsViaSymbols())
- _subsectionsViaSymbols = false;
+ if (auto *machoFile = dyn_cast<mach_o::MachOFile>(&atom->file()))
+ if (!machoFile->subsectionsViaSymbols())
+ _subsectionsViaSymbols = false;
}
void Util::assignAtomToSection(const DefinedAtom *atom) {
OpenPOWER on IntegriCloud