Skip to content

Commit ccdd09e

Browse files
hcahcaPeter Zijlstra
authored andcommitted
objtool: Add missing endian conversion to read_annotate()
Trying to compile an x86 kernel on big endian results in this error: net/ipv4/netfilter/iptable_nat.o: warning: objtool: iptable_nat_table_init+0x150: Unknown annotation type: 50331648 make[5]: *** [scripts/Makefile.build:287: net/ipv4/netfilter/iptable_nat.o] Error 255 Reason is a missing endian conversion in read_annotate(). Add the missing conversion to fix this. Fixes: 2116b34 ("objtool: Generic annotation infrastructure") Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent d0b3b7b commit ccdd09e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/objtool/check.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,7 @@ static int read_annotate(struct objtool_file *file,
23182318

23192319
for_each_reloc(sec->rsec, reloc) {
23202320
type = *(u32 *)(sec->data->d_buf + (reloc_idx(reloc) * sec->sh.sh_entsize) + 4);
2321+
type = bswap_if_needed(file->elf, type);
23212322

23222323
offset = reloc->sym->offset + reloc_addend(reloc);
23232324
insn = find_insn(file, reloc->sym->sec, offset);

0 commit comments

Comments
 (0)