summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/LinkerScript.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 6b5a0274304..a489943d62c 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -386,9 +386,11 @@ LinkerScript::computeInputSections(const InputSectionDescription *cmd) {
// which are common because they are in the default bfd script.
// We do not ignore SHT_REL[A] linker-synthesized sections here because
// want to support scripts that do custom layout for them.
- if (auto *isec = dyn_cast<InputSection>(sec))
- if (isec->getRelocatedSection())
- continue;
+ //
+ // It is safe to assume that Sec is an InputSection because mergeable or
+ // EH input sections have already been handled and eliminated.
+ if (cast<InputSection>(sec)->getRelocatedSection())
+ continue;
std::string filename = getFilename(sec->file);
if (!cmd->filePat.match(filename) ||
@@ -396,9 +398,6 @@ LinkerScript::computeInputSections(const InputSectionDescription *cmd) {
!pat.sectionPat.match(sec->name))
continue;
- // It is safe to assume that Sec is an InputSection
- // because mergeable or EH input sections have already been
- // handled and eliminated.
ret.push_back(cast<InputSection>(sec));
sec->assigned = true;
}
OpenPOWER on IntegriCloud