[COFF] Write the debug directory and build id to a separate section for MinGW
authorMartin Storsjo <martin@martin.st>
Fri, 20 Jul 2018 05:44:34 +0000 (05:44 +0000)
committerMartin Storsjo <martin@martin.st>
Fri, 20 Jul 2018 05:44:34 +0000 (05:44 +0000)
commita55fc7161481ec4410a55c2e1b82d7c6d68949d6
treee95781c9a1c1585359d11b2d6b3fdca8d47c2ff7
parentea9c580994a7b40cd31128d2e4ecba9d7795b22b
[COFF] Write the debug directory and build id to a separate section for MinGW

For dwarf debug info, an executable normally either contains the debug
info, or it is stripped out. To reduce the storage needed (slightly)
for the debug info kept separately from the released, stripped binaries,
one can choose to only copy the debug data from the original executable
(essentially the reverse of the strip operation), producing a file with
only debug info.

When copying the debug data from an executable with GNU objcopy,
the build id and debug directory need to reside in a separate section,
as this will be kept while the rest of the .rdata section is removed.

Differential Revision: https://reviews.llvm.org/D49352

llvm-svn: 337526
lld/COFF/Writer.cpp
lld/test/COFF/debug-reloc.s