From 091bf313f8a852a7f30c3a8dcef569edfd06f5dc Mon Sep 17 00:00:00 2001 From: Tiezhu Yang Date: Tue, 11 Feb 2025 19:50:11 +0800 Subject: 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 Link: https://lore.kernel.org/r/20250211115016.26913-3-yangtiezhu@loongson.cn Acked-by: Huacai Chen Signed-off-by: Josh Poimboeuf --- tools/objtool/include/objtool/arch.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/objtool/include') diff --git a/tools/objtool/include/objtool/arch.h b/tools/objtool/include/objtool/arch.h index d63b46a19f39..396f7c6c81c0 100644 --- a/tools/objtool/include/objtool/arch.h +++ b/tools/objtool/include/objtool/arch.h @@ -97,4 +97,6 @@ int arch_rewrite_retpolines(struct objtool_file *file); bool arch_pc_relative_reloc(struct reloc *reloc); +unsigned int arch_reloc_size(struct reloc *reloc); + #endif /* _ARCH_H */ -- cgit v1.2.3