objtool: Fix type of reloc::addend
authorPeter Zijlstra <peterz@infradead.org>
Sun, 17 Apr 2022 15:03:40 +0000 (17:03 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 22 Apr 2022 10:13:55 +0000 (12:13 +0200)
commitc087c6e7b551b7f208c0b852304f044954cf2bb3
treededb165441c56244675fffdd2bb8ce45840b4add
parent08feafe8d1958febf3a9733a3d1564d8fc23340e
objtool: Fix type of reloc::addend

Elf{32,64}_Rela::r_addend is of type: Elf{32,64}_Sword, that means
that our reloc::addend needs to be long or face tuncation issues when
we do elf_rebuild_reloc_section():

  - 107:  48 b8 00 00 00 00 00 00 00 00   movabs $0x0,%rax        109: R_X86_64_64        level4_kernel_pgt+0x80000067
  + 107:  48 b8 00 00 00 00 00 00 00 00   movabs $0x0,%rax        109: R_X86_64_64        level4_kernel_pgt-0x7fffff99

Fixes: 627fce14809b ("objtool: Add ORC unwind table generation")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lkml.kernel.org/r/20220419203807.596871927@infradead.org
tools/objtool/check.c
tools/objtool/elf.c
tools/objtool/include/objtool/elf.h