This is an archive of the discontinued LLVM Phabricator instance.

COFF: Minor fix to Section size calculation
AbandonedPublic

Authored by loladiro on Jun 10 2014, 10:49 AM.

Details

Reviewers
None
Summary

I noticed llvm-dwarfdump was crashing on COFF dlls with embedded DWARF debug info. The reason was that SizeOfRawData actually indicates the size on disc which is not the size of the actual section data in a PE file (*.dll, *.exe), because of alignment rules. Instead the size of given by min(SizeOfRawData,VirtualSize).

I'm not sure what to do with respect to testing, since compiling a file from source would require a COFF capable linker. Is it acceptable to commit an entire PE exectuable to the repository? If so, I'll try to come up with a minimal example where this happens.

Diff Detail

Event Timeline

loladiro updated this revision to Diff 10286.Jun 10 2014, 10:49 AM
loladiro retitled this revision from to COFF: Minor fix to Section size calculation.
loladiro updated this object.
loladiro edited the test plan for this revision. (Show Details)
loladiro added a subscriber: Unknown Object (MLST).

It is acceptable to put in a fully linked binary.

One more comment below.

Thanks!

lib/Object/COFFObjectFile.cpp
835

Instead of later on, how about a comment about "after linking"?

Ok, I will come up with a test case test.

lib/Object/COFFObjectFile.cpp
835

Hmm, I intended it to mean, "later when LLVM is looking at the debug info". I see that this wording might be confusing. Will reword.

loladiro abandoned this revision.Oct 28 2014, 3:10 PM

Closed independently in r219388