objtool: Add missing endianess conversion when checking annations
PATCH 1/1 objtool: Add missing endianess conversion when checking annations
cross-compiling a kernel for x86 on s390 produces the following warning:
drivers/mfd/mc13xxx-core.o: warning: objtool: mc13xxx_reg_rmw+0xc: Unknown annotation type: 50331648
Fix this by adding the required endianess conversion.
--- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/objtool/check.c +1 -1
@@ -2316,7 +2316,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);
Signature · 1 line
2.45.2
Quoted 18 lines · Sven Schnelle
cross-compiling a kernel for x86 on s390 produces the following warning:
drivers/mfd/mc13xxx-core.o: warning: objtool:mc13xxx_reg_rmw+0xc: Unknown annotation type: 50331648Fix this by adding the required endianess conversion.
Fixes 2116b349e29a ("objtool: Generic annotation infrastructure")Reported-by Alexander Gordeev <[email protected]>Signed-off-by Sven Schnelle <[email protected]>--- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/objtool/check.c +0
-0
tools/objtool/check.c static int read_annotate(struct objtool_file *file, · line 2322
Quoted 8 lines
tools/objtool/check.c +1
-1@@ -2316,7 +2316,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);
Quoted 18 lines · Sven Schnelle
cross-compiling a kernel for x86 on s390 produces the following warning:
drivers/mfd/mc13xxx-core.o: warning: objtool:mc13xxx_reg_rmw+0xc: Unknown annotation type: 50331648Fix this by adding the required endianess conversion.
Fixes 2116b349e29a ("objtool: Generic annotation infrastructure")Reported-by Alexander Gordeev <[email protected]>Signed-off-by Sven Schnelle <[email protected]>--- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/objtool/check.c +0
-0
tools/objtool/check.c static int read_annotate(struct objtool_file *file, · line 2322
Quoted 8 lines
tools/objtool/check.c +1
-1@@ -2316,7 +2316,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);
Gentle ping?
Peter Zijlstra
maintainerQuoted 22 lines · Sven Schnelle
Quoted 20 lines · Sven Schnelle
cross-compiling a kernel for x86 on s390 produces the following warning:
drivers/mfd/mc13xxx-core.o: warning: objtool:mc13xxx_reg_rmw+0xc: Unknown annotation type: 50331648Fix this by adding the required endianess conversion.
Fixes 2116b349e29a ("objtool: Generic annotation infrastructure")Reported-by Alexander Gordeev <[email protected]>Signed-off-by Sven Schnelle <[email protected]>--- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/objtool/check.c +0
-0@@ -2316,7 +2316,7 @@ static int read_annotate(struct objtool_file *file, }
Quoted 8 lines
tools/objtool/check.c static int read_annotate(struct objtool_file *file, · line 2322
Quoted 6 lines
tools/objtool/check.c +1
-1for_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);Gentle ping?
Oh, I missed there were two of these. I merged this:
https://lkml.kernel.org/r/175137563313.406.6298042704364318030.tip-bot2@tip-bot2
Quoted 27 lines · Peter Zijlstra
Quoted 26 lines · Sven Schnelle
Quoted 24 lines · Sven Schnelle
cross-compiling a kernel for x86 on s390 produces the following warning:
drivers/mfd/mc13xxx-core.o: warning: objtool:mc13xxx_reg_rmw+0xc: Unknown annotation type: 50331648Fix this by adding the required endianess conversion.
Fixes 2116b349e29a ("objtool: Generic annotation infrastructure")Reported-by Alexander Gordeev <[email protected]>Signed-off-by Sven Schnelle <[email protected]>--- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/objtool/check.c +1
-1@@ -2316,7 +2316,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 ));
Quoted 8 lines
Quoted 4 lines
tools/objtool/check.c static int read_annotate(struct objtool_file *file, · line 2322
Quoted 2 lines
tools/objtool/check.c +0
-0offset = reloc->sym->offset +reloc_addend (reloc); insn =find_insn (file, reloc->sym->sec, offset);Gentle ping?
Oh, I missed there were two of these. I merged this:
https://lkml.kernel.org/r/175137563313.406.6298042704364318030.tip-bot2@tip-bot2
Ok, thanks!