diff mbox series

[v5,01/15] objtool: Fix generic annotation infrastructure cross build

Message ID 0ac0217b174efcefe772822089e9b64ff8c65da3.1736955567.git.christophe.leroy@csgroup.eu (mailing list archive)
State Changes Requested
Headers show
Series powerpc/objtool: uaccess validation for PPC32 (v5) | expand

Commit Message

Christophe Leroy Jan. 15, 2025, 10:42 p.m. UTC
Cross build for powerpc/32 on x86_64 leads to:

  CC      init/main.o
init/main.o: warning: objtool: early_randomize_kstack_offset+0xf0: Unknown annotation type: 134217728
init/main.o: warning: objtool: start_kernel+0x4a8: Unknown annotation type: 134217728
init/main.o: warning: objtool: do_one_initcall+0x178: Unknown annotation type: 134217728

Fix byte order.

Fixes: 2116b349e29a ("objtool: Generic annotation infrastructure")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
v5: New in v5
---
 tools/objtool/check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index e92c5564d9ca..129c4e2245ae 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2272,7 +2272,7 @@  static int read_annotate(struct objtool_file *file,
 	}
 
 	for_each_reloc(sec->rsec, reloc) {
-		type = *(u32 *)(sec->data->d_buf + (reloc_idx(reloc) * sec->sh.sh_entsize) + 4);
+		type = bswap_if_needed(file->elf, *(u32 *)(sec->data->d_buf + (reloc_idx(reloc) * sec->sh.sh_entsize) + 4));
 
 		offset = reloc->sym->offset + reloc_addend(reloc);
 		insn = find_insn(file, reloc->sym->sec, offset);