This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Clarify comment. NFC
ClosedPublic

Authored by smeenai on Jan 29 2018, 1:32 PM.

Details

Summary

Reid pointed out the string table for supporting long section names is a
BFD extension and the comments should reflect that. Explicitly spell out
link.exe's and binutil's behavior around section names and the rationale
for LLD's behavior.

Diff Detail

Repository
rL LLVM

Event Timeline

smeenai created this revision.Jan 29 2018, 1:32 PM
mstorsjo added inline comments.Jan 29 2018, 1:47 PM
COFF/Writer.cpp
577 ↗(On Diff #131867)

Not sure about non-standard though, since iirc dumpbin at least shows them correctly - so the extension is at least acknowledged by MS that much.

Super belated ping.

COFF/Writer.cpp
577 ↗(On Diff #131867)

It's non-standard in the sense that the spec explicitly says "Executable images do not use a string table and do not support section names longer than 8 characters." My guess is that dumpbin either doesn't specialize the string table reading logic for executables (i.e. it just uses the same logic for object files and executables), or they explicitly allow it to play better with binutils. Either way, I think non-standard is a fair way to put it.

rnk accepted this revision.Mar 16 2018, 11:06 AM

lgtm, this is very clear. :)

This revision is now accepted and ready to land.Mar 16 2018, 11:06 AM
ruiu accepted this revision.Mar 16 2018, 12:23 PM

LGTM

This revision was automatically updated to reflect the committed changes.