This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly][MC] Simplify WasmObjectWriter::recordRelocation. NFC.
ClosedPublic

Authored by sbc100 on Aug 19 2019, 5:33 PM.

Details

Reviewers
sunfish
dschuff
Summary

WebAssembly doesn't support PC relative relocation or relocation
expressions that can't be reduced to single symbol.

The only support for we have for fixups involving two symbols are when
both symbols are defined and withing the same section. In this case
evaluateFixup will already have evaluated to the expression before
calling recordRelocation.

Event Timeline

sbc100 created this revision.Aug 19 2019, 5:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2019, 5:33 PM

I mistakenly landed this change already, so this is post-commit review. Happy to revert if needed.

So it looks like this change is just that we now report an error where it asserted before?

So it looks like this change is just that we now report an error where it asserted before?

Also removes a bunch of redundant code (which I think was originally copied from the ELF file writer).

dschuff accepted this revision.Aug 20 2019, 2:19 PM
This revision is now accepted and ready to land.Aug 20 2019, 2:19 PM
sbc100 closed this revision.Aug 20 2019, 2:29 PM

This landed as rL369317