This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Error on unexpected .pdata size
ClosedPublic

Authored by hans on Jul 9 2020, 5:58 AM.

Details

Summary

Previously, lld would crash if the .pdata size is not an even multiple of the expected .pdata entry size. This makes it error instead.

(We hit this in Chromium due to an assembler problem: https://crbug.com/1101577)

Diff Detail

Event Timeline

hans created this revision.Jul 9 2020, 5:58 AM
thakis accepted this revision.Jul 9 2020, 8:49 AM

Nice!

This revision is now accepted and ready to land.Jul 9 2020, 8:49 AM
MaskRay added inline comments.Jul 9 2020, 8:55 AM
lld/COFF/Writer.cpp
1868

Nit: Twine(end-begin)

... to avoid a temporary std::string.

lld/test/COFF/pdata-arm64-bad.yaml
2

yaml2obj %s -o %t.obj

Drop the # on the empty line.

MaskRay added inline comments.Jul 9 2020, 8:56 AM
lld/test/COFF/pdata-arm64-bad.yaml
6

The yaml can be further simplified.

hans marked 6 inline comments as done.Jul 13 2020, 4:39 AM
hans added inline comments.
lld/COFF/Writer.cpp
1868

Thanks! That's nicer.

lld/test/COFF/pdata-arm64-bad.yaml
2

Actually, I'll drop the empty line :)

6

It could be simplified a lot and still hit the error case here, but to ensure that the rest of the file makes sense, I'd prefer to keep it as it is: just a small modification to the known good pdata-arm64.yaml file.

This revision was automatically updated to reflect the committed changes.
hans marked 3 inline comments as done.
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2020, 4:39 AM