llvm-readobj: Fix addend in relocations for android packed format
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 15 Aug 2018 17:58:22 +0000 (17:58 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 15 Aug 2018 17:58:22 +0000 (17:58 +0000)
commit62e4fc48a58a8e1cc85d6059a380012f91da0b9c
treedab112168cf86539387ec57565fc92cd332149a6
parent39fe4808320be925bf7c7e43443cc0d938786e4a
llvm-readobj: Fix addend in relocations for android packed format

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.

Patch by Yi-Yo Chiang!

Differential Revision: https://reviews.llvm.org/D50601

llvm-svn: 339799
llvm/lib/Object/ELF.cpp
llvm/test/tools/llvm-readobj/elf-packed-relocs.test