This is an archive of the discontinued LLVM Phabricator instance.

[COFF][ARM] Apply an existing offset in MOV32T relocations
ClosedPublic

Authored by mstorsjo on Aug 2 2016, 4:57 AM.

Details

Summary

Don't blindly OR in the new value, but clear the existing one, since
it can be nonzero. Read out the existing value before, and add
into the desired offset. (The add is done outside of the applyMOV,
to handle potential overflow between the two.)

Diff Detail

Event Timeline

mstorsjo updated this revision to Diff 66459.Aug 2 2016, 4:57 AM
mstorsjo retitled this revision from to [COFF][ARM] Apply an existing offset in MOV32T relocations.
mstorsjo updated this object.
mstorsjo added reviewers: peter.smith, zatrazz.
mstorsjo added a subscriber: llvm-commits.
compnerd edited edge metadata.Aug 4 2016, 5:32 PM

Hmm, does the input actually contain a relocation with an addend? I see that you updated the test but not the input?

Hmm, does the input actually contain a relocation with an addend? I see that you updated the test but not the input?

I updated the input SectionData of the test as well, to contain a movw/movt pair with a nonzero addend.

compnerd accepted this revision.Aug 5 2016, 10:42 AM
compnerd edited edge metadata.
This revision is now accepted and ready to land.Aug 5 2016, 10:42 AM

This one should apply cleanly on top of the latest SVN trunk now that D23053 is applied in r277836 (they both touched the same SectionData line in the test).

compnerd closed this revision.Aug 5 2016, 11:31 AM

SVN r277846