objtool: Handle different entry size of rodata
authorTiezhu Yang <yangtiezhu@loongson.cn>
Tue, 11 Feb 2025 11:50:11 +0000 (19:50 +0800)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 12 Mar 2025 22:43:38 +0000 (15:43 -0700)
commit091bf313f8a852a7f30c3a8dcef569edfd06f5dc
tree2447b795d16e1763249a446642edfb5688176000
parentab6ce22b789622ca732e91cbb3a5cb5ba370cbd0
objtool: Handle different entry size of rodata

In the most cases, the entry size of rodata is 8 bytes because the
relocation type is 64 bit. There are also 32 bit relocation types,
the entry size of rodata should be 4 bytes in this case.

Add an arch-specific function arch_reloc_size() to assign the entry
size of rodata for x86, powerpc and LoongArch.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Link: https://lore.kernel.org/r/20250211115016.26913-3-yangtiezhu@loongson.cn
Acked-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
tools/objtool/arch/loongarch/decode.c
tools/objtool/arch/powerpc/decode.c
tools/objtool/arch/x86/decode.c
tools/objtool/check.c
tools/objtool/include/objtool/arch.h