This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [COFF] Write the debug directory and build id to a separate section for MinGW
ClosedPublic

Authored by mstorsjo on Jul 15 2018, 1:42 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Jul 15 2018, 1:42 PM
rnk accepted this revision.Jul 19 2018, 11:37 AM

lgtm

This revision is now accepted and ready to land.Jul 19 2018, 11:37 AM
pcc added inline comments.Jul 19 2018, 11:47 AM
COFF/Writer.cpp
425 ↗(On Diff #155597)

You could create the section unconditionally; we'll end up discarding empty sections later.

mstorsjo added inline comments.Jul 19 2018, 12:00 PM
COFF/Writer.cpp
425 ↗(On Diff #155597)

Thanks, will change that before committing.

This revision was automatically updated to reflect the committed changes.