aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lld/ELF/LinkerScript.cpp')
-rw-r--r--contrib/llvm-project/lld/ELF/LinkerScript.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/llvm-project/lld/ELF/LinkerScript.cpp b/contrib/llvm-project/lld/ELF/LinkerScript.cpp
index 28ae4b854306..03aec187668a 100644
--- a/contrib/llvm-project/lld/ELF/LinkerScript.cpp
+++ b/contrib/llvm-project/lld/ELF/LinkerScript.cpp
@@ -57,6 +57,10 @@ static StringRef getOutputSectionName(const InputSectionBase *s) {
if (auto *isec = dyn_cast<InputSection>(s)) {
if (InputSectionBase *rel = isec->getRelocatedSection()) {
OutputSection *out = rel->getOutputSection();
+ if (!out) {
+ assert(config->relocatable && (rel->flags & SHF_LINK_ORDER));
+ return s->name;
+ }
if (s->type == SHT_RELA)
return saver().save(".rela" + out->name);
return saver().save(".rel" + out->name);