Index: lld/trunk/ELF/MarkLive.cpp =================================================================== --- lld/trunk/ELF/MarkLive.cpp +++ lld/trunk/ELF/MarkLive.cpp @@ -70,7 +70,8 @@ return true; default: StringRef S = Sec->getSectionName(); - return S.startswith(".init") || S.startswith(".fini") || + return S.startswith(".ctors") || S.startswith(".dtors") || + S.startswith(".init") || S.startswith(".fini") || S.startswith(".jcr"); } } Index: lld/trunk/test/ELF/gc-sections.s =================================================================== --- lld/trunk/test/ELF/gc-sections.s +++ lld/trunk/test/ELF/gc-sections.s @@ -10,6 +10,8 @@ # NOGC: Name: .eh_frame # NOGC: Name: .text +# NOGC: Name: .ctors +# NOGC: Name: .dtors # NOGC: Name: .init # NOGC: Name: .fini # NOGC: Name: a @@ -23,6 +25,8 @@ # GC1: Name: .eh_frame # GC1: Name: .text +# GC1: Name: .ctors +# GC1: Name: .dtors # GC1: Name: .init # GC1: Name: .fini # GC1: Name: a @@ -36,6 +40,8 @@ # GC2: Name: .eh_frame # GC2: Name: .text +# GC2: Name: .ctors +# GC2: Name: .dtors # GC2: Name: .init # GC2: Name: .fini # GC2: Name: a @@ -77,6 +83,12 @@ y: call x +.section .ctors,"aw",@progbits + .quad 0 + +.section .dtors,"aw",@progbits + .quad 0 + .section .init,"aw",@init_array .quad 0