summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/MarkLive.cpp3
-rw-r--r--lld/test/elf2/gc-sections.s6
2 files changed, 8 insertions, 1 deletions
diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp
index 691a9d41252..8f255e25a37 100644
--- a/lld/ELF/MarkLive.cpp
+++ b/lld/ELF/MarkLive.cpp
@@ -85,7 +85,8 @@ template <class ELFT> static bool isReserved(InputSectionBase<ELFT> *Sec) {
return true;
default:
StringRef S = Sec->getSectionName();
- return S.startswith(".init") || S.startswith(".fini");
+ return S.startswith(".init") || S.startswith(".fini") ||
+ S.startswith(".jcr") || S == ".eh_frame";
}
}
diff --git a/lld/test/elf2/gc-sections.s b/lld/test/elf2/gc-sections.s
index 08da885e7b3..d6632e2075b 100644
--- a/lld/test/elf2/gc-sections.s
+++ b/lld/test/elf2/gc-sections.s
@@ -9,6 +9,7 @@
# RUN: llvm-readobj -sections -symbols %t2 | FileCheck -check-prefix=GC2 %s
# NOGC: Name: .text
+# NOGC: Name: .eh_frame
# NOGC: Name: .init
# NOGC: Name: .fini
# NOGC: Name: a
@@ -21,6 +22,7 @@
# NOGC: Name: d
# GC1: Name: .text
+# GC1: Name: .eh_frame
# GC1: Name: .init
# GC1: Name: .fini
# GC1: Name: a
@@ -33,6 +35,7 @@
# GC1-NOT: Name: d
# GC2: Name: .text
+# GC2: Name: .eh_frame
# GC2: Name: .init
# GC2: Name: .fini
# GC2: Name: a
@@ -82,3 +85,6 @@ y:
.section .preinit_array,"aw",@preinit_array
.quad 0
+
+.section .eh_frame,"aw",@progbits
+ .quad 0
OpenPOWER on IntegriCloud