[COFF] Don't treat DWARF sections as GC roots
authorReid Kleckner <rnk@google.com>
Fri, 27 Mar 2020 16:09:06 +0000 (09:09 -0700)
committerReid Kleckner <rnk@google.com>
Fri, 27 Mar 2020 19:37:43 +0000 (12:37 -0700)
commitc579a5b1d92a9bc2046d00ee2d427832e0f5ddec
treebeb9855af1397af4269aaf581b7f52f5eb1eae2e
parent457eb05db67d201f34920e762a90d0deb670becb
[COFF] Don't treat DWARF sections as GC roots

DWARF sections are typically live and not COMDAT, so they would be
treated as GC roots. Enabling DWARF would essentially keep all code with
debug info alive, preventing any section GC.

Fixes PR45273

Reviewed By: mstorsjo, MaskRay

Differential Revision: https://reviews.llvm.org/D76935
lld/COFF/MarkLive.cpp
lld/test/COFF/gc-dwarf.s [new file with mode: 0644]