summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/OutputSections.cpp2
-rw-r--r--lld/test/ELF/eh-frame-rel.s7
2 files changed, 8 insertions, 1 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index bbf4be04cfc..f8ea29f068d 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -1003,7 +1003,7 @@ template <class ELFT> void EHOutputSection<ELFT>::writeTo(uint8_t *Buf) {
if (RelSec->sh_type == SHT_RELA)
S->relocate(Buf, nullptr, EObj.relas(RelSec));
else
- S->relocate(Buf, nullptr, EObj.relas(RelSec));
+ S->relocate(Buf, nullptr, EObj.rels(RelSec));
}
}
diff --git a/lld/test/ELF/eh-frame-rel.s b/lld/test/ELF/eh-frame-rel.s
new file mode 100644
index 00000000000..a417dc12608
--- /dev/null
+++ b/lld/test/ELF/eh-frame-rel.s
@@ -0,0 +1,7 @@
+// REQUIRES: x86
+// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
+// RUN: ld.lld %t.o %t.o -o %t -shared
+// We used to try to read the relocations as RELA and error out
+
+ .cfi_startproc
+ .cfi_endproc
OpenPOWER on IntegriCloud