This is an archive of the discontinued LLVM Phabricator instance.

[MC][WebAssembly] Fix crash when relocation addend underflows U32
ClosedPublic

Authored by sbc100 on Feb 24 2022, 3:39 PM.

Details

Summary

For the object file writer we need to allow the underflow (ar write
zero), but for the final linker output we should probably generate an
error (I've left that as a TODO for now).

Fixes: https://github.com/llvm/llvm-project/issues/54012

Diff Detail

Event Timeline

sbc100 created this revision.Feb 24 2022, 3:39 PM
sbc100 requested review of this revision.Feb 24 2022, 3:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 24 2022, 3:39 PM
sbc100 updated this revision to Diff 411248.Feb 24 2022, 3:44 PM
  • more testing
sbc100 updated this revision to Diff 411251.Feb 24 2022, 3:50 PM
  • cleanup
dschuff accepted this revision.Feb 24 2022, 5:22 PM
dschuff added inline comments.
lld/wasm/InputChunks.cpp
119–122

Would this be the place to put the underflow check? If so, maybe a TODO here as well as in the test?

This revision is now accepted and ready to land.Feb 24 2022, 5:22 PM
sbc100 retitled this revision from [MC][WebAssembly] Fix crash when relocation addend underlows U32 to [MC][WebAssembly] Fix crash when relocation addend underflows U32.Feb 25 2022, 7:14 AM
sbc100 marked an inline comment as done.
This revision was landed with ongoing or failed builds.Feb 25 2022, 7:15 AM
This revision was automatically updated to reflect the committed changes.