This is an archive of the discontinued LLVM Phabricator instance.

PECOFF: Use the string table for long section names in EXEs/DLLs
ClosedPublic

Authored by majnemer on Nov 3 2014, 4:31 PM.

Details

Summary

Normally, PE files have section names of eight characters or less.
However, this is problematic for DWARF because DWARF section names are
things like .debug_aranges.

Instead of truncating the section name, redirect the section name into
the string table.

Diff Detail

Event Timeline

majnemer updated this revision to Diff 15741.Nov 3 2014, 4:31 PM
majnemer retitled this revision from to PECOFF: Use the string table for long section names in EXEs/DLLs.
majnemer updated this object.
majnemer added a reviewer: ruiu.
majnemer added a subscriber: Unknown Object (MLST).
ruiu accepted this revision.Nov 3 2014, 4:37 PM
ruiu edited edge metadata.

LGTM with a few nits

lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
203

Add blank lines between no one-liner methods.

793

Please add a comment saying that we support long section name even in an executable, which is a GNU extension to PE/COFF. Also note that dumpbin cannot handle that at this moment.

797

Move this line before the previous if. I think we need to zero-pad after "/%u".

This revision is now accepted and ready to land.Nov 3 2014, 4:37 PM
majnemer closed this revision.Nov 3 2014, 5:04 PM
majnemer updated this revision to Diff 15743.

Closed by commit rL221212 (authored by @majnemer).