[PATCH] D24733: [ELF] Add .debug* and .comment sections to the list of sections ignored by GC.
Eugene Leviant via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 23 09:09:46 PDT 2016
evgeny777 updated this revision to Diff 72296.
evgeny777 added a comment.
Diff updated.
https://reviews.llvm.org/D24733
Files:
ELF/MarkLive.cpp
test/ELF/gc-sections.s
Index: test/ELF/gc-sections.s
===================================================================
--- test/ELF/gc-sections.s
+++ test/ELF/gc-sections.s
@@ -14,6 +14,8 @@
# NOGC: Name: .dtors
# NOGC: Name: .init
# NOGC: Name: .fini
+# NOGC: Name: .debug_pubtypes
+# NOGC: Name: .comment
# NOGC: Name: a
# NOGC: Name: b
# NOGC: Name: c
@@ -100,3 +102,9 @@
.section .eh_frame,"a", at unwind
.quad 0
+
+.section .debug_pubtypes,"", at progbits
+ .quad 0
+
+.section .comment,"MS", at progbits,8
+ .quad 0
Index: ELF/MarkLive.cpp
===================================================================
--- ELF/MarkLive.cpp
+++ ELF/MarkLive.cpp
@@ -183,7 +183,8 @@
if (isValidCIdentifier(S))
return true;
- return S.startswith(".ctors") || S.startswith(".dtors") ||
+ bool IsAllocSec = Sec->getSectionHdr()->sh_flags & SHF_ALLOC;
+ return !IsAllocSec || S.startswith(".ctors") || S.startswith(".dtors") ||
S.startswith(".init") || S.startswith(".fini") ||
S.startswith(".jcr");
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24733.72296.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160923/709b4520/attachment.bin>
More information about the llvm-commits
mailing list