This is an archive of the discontinued LLVM Phabricator instance.

llvm-readobj: Fix addend in relocations for android packed format
ClosedPublic

Authored by yo on Aug 11 2018, 3:33 AM.

Details

Summary

If a relocation group doesn't have the RELOCATION_GROUP_HAS_ADDEND_FLAG set, then this implies the group's addend equals zero.
In this case android packed format won't encode an explicit addend delta, instead we need to set Addend, the "previous addend" variable, to zero by ourself.
Fixes: rL316543

Diff Detail

Repository
rL LLVM

Event Timeline

yo created this revision.Aug 11 2018, 3:33 AM
yo edited the summary of this revision. (Show Details)Aug 11 2018, 3:34 AM
yo added reviewers: pcc, ruiu.
yo edited the summary of this revision. (Show Details)
pcc added inline comments.Aug 13 2018, 4:15 PM
lib/Object/ELF.cpp
405–411 ↗(On Diff #160238)

This can be simplified to

if (GroupHasAddend && !GroupedByAddend)
  Addend += ReadSLEB();
R.r_addend = Addend;
yo updated this revision to Diff 160510.Aug 13 2018, 8:15 PM
yo marked an inline comment as done.
pcc accepted this revision.Aug 13 2018, 9:51 PM

LGTM

Do you have commit access?

This revision is now accepted and ready to land.Aug 13 2018, 9:51 PM
yo added a comment.Aug 13 2018, 10:45 PM

Nope. Please commit it for me. Thanks!

yo added a comment.EditedAug 15 2018, 10:48 AM

Ping! Please submit this on my behalf.

This revision was automatically updated to reflect the committed changes.