This is an archive of the discontinued LLVM Phabricator instance.

[COFF][ARM] Clear the J1 and J2 bits when applying relocations to 24 bit branches
ClosedPublic

Authored by mstorsjo on Aug 2 2016, 1:03 AM.

Details

Summary

The opcode for the bl branches can initially be F000 F800, i.e.
the J1 and J2 bits are already set. Therefore mask these bits out
before or'ing in the new bits.

Diff Detail

Event Timeline

mstorsjo updated this revision to Diff 66436.Aug 2 2016, 1:03 AM
mstorsjo retitled this revision from to [COFF][ARM] Clear the J1 and J2 bits when applying relocations to 24 bit branches.
mstorsjo updated this object.
mstorsjo added a subscriber: llvm-commits.
peter.smith edited edge metadata.Aug 4 2016, 7:19 AM

Hello Martin,

I'm away on holiday with limited internet and no access to a computer, so I can't check the details till I get back at some point next week. I suggest adding the code-owner for the COFF part of lld, Rui Ueyama as you'd likely need to get some input from him on the coding style.

ruiu edited edge metadata.

Adding Saleem as a reviewer because he knows more about ARM than me.

compnerd accepted this revision.Aug 4 2016, 5:30 PM
compnerd edited edge metadata.
compnerd added inline comments.
COFF/Chunks.cpp
107

Yeah, the bits need to be cleared out as the value may be altered by the new computation.

There is no guarantee that the bits are set IIRC, so I find the comment misleading. You can add a comment along the lines of clear out the J1 and J2 bits which may be set, though, Im not sure if it really adds much value.

This revision is now accepted and ready to land.Aug 4 2016, 5:30 PM
mstorsjo added inline comments.Aug 4 2016, 10:26 PM
COFF/Chunks.cpp
107

Ok, uploading a new version of the patch with the comment changed.

mstorsjo updated this revision to Diff 66905.Aug 4 2016, 10:26 PM
mstorsjo updated this object.
mstorsjo edited edge metadata.

Updated the comment and the summary text

compnerd closed this revision.Aug 5 2016, 10:36 AM

SVN r277836