* [PATCH] objtool: Add missing endianess conversion when checking annations
@ 2025-05-14 13:35 Sven Schnelle
2025-05-14 16:13 ` Alexander Gordeev
2025-07-02 8:30 ` Sven Schnelle
0 siblings, 2 replies; 5+ messages in thread
From: Sven Schnelle @ 2025-05-14 13:35 UTC (permalink / raw)
To: Josh Poimboeuf, Peter Zijlstra; +Cc: linux-kernel, Alexander Gordeev
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.
Fixes: 2116b349e29a ("objtool: Generic annotation infrastructure")
Reported-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
---
tools/objtool/check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index b21b12ec88d9..35fb871b2c62 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -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);
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] objtool: Add missing endianess conversion when checking annations
2025-05-14 13:35 [PATCH] objtool: Add missing endianess conversion when checking annations Sven Schnelle
@ 2025-05-14 16:13 ` Alexander Gordeev
2025-07-02 8:30 ` Sven Schnelle
1 sibling, 0 replies; 5+ messages in thread
From: Alexander Gordeev @ 2025-05-14 16:13 UTC (permalink / raw)
To: Sven Schnelle; +Cc: Josh Poimboeuf, Peter Zijlstra, linux-kernel
On Wed, May 14, 2025 at 03:35:15PM +0200, Sven Schnelle wrote:
> 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.
>
> Fixes: 2116b349e29a ("objtool: Generic annotation infrastructure")
> Reported-by: Alexander Gordeev <agordeev@linux.ibm.com>
> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
> ---
> tools/objtool/check.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index b21b12ec88d9..35fb871b2c62 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -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);
Tested-by: Alexander Gordeev <agordeev@linux.ibm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] objtool: Add missing endianess conversion when checking annations
2025-05-14 13:35 [PATCH] objtool: Add missing endianess conversion when checking annations Sven Schnelle
2025-05-14 16:13 ` Alexander Gordeev
@ 2025-07-02 8:30 ` Sven Schnelle
2025-07-02 8:38 ` Peter Zijlstra
1 sibling, 1 reply; 5+ messages in thread
From: Sven Schnelle @ 2025-07-02 8:30 UTC (permalink / raw)
To: Josh Poimboeuf; +Cc: Peter Zijlstra, linux-kernel, Alexander Gordeev
Sven Schnelle <svens@linux.ibm.com> writes:
> 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.
>
> Fixes: 2116b349e29a ("objtool: Generic annotation infrastructure")
> Reported-by: Alexander Gordeev <agordeev@linux.ibm.com>
> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
> ---
> tools/objtool/check.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index b21b12ec88d9..35fb871b2c62 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -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?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] objtool: Add missing endianess conversion when checking annations
2025-07-02 8:30 ` Sven Schnelle
@ 2025-07-02 8:38 ` Peter Zijlstra
2025-07-02 10:03 ` Sven Schnelle
0 siblings, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2025-07-02 8:38 UTC (permalink / raw)
To: Sven Schnelle; +Cc: Josh Poimboeuf, linux-kernel, Alexander Gordeev
On Wed, Jul 02, 2025 at 10:30:51AM +0200, Sven Schnelle wrote:
> Sven Schnelle <svens@linux.ibm.com> writes:
>
> > 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.
> >
> > Fixes: 2116b349e29a ("objtool: Generic annotation infrastructure")
> > Reported-by: Alexander Gordeev <agordeev@linux.ibm.com>
> > Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
> > ---
> > tools/objtool/check.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> > index b21b12ec88d9..35fb871b2c62 100644
> > --- a/tools/objtool/check.c
> > +++ b/tools/objtool/check.c
> > @@ -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?
Oh, I missed there were two of these. I merged this:
https://lkml.kernel.org/r/175137563313.406.6298042704364318030.tip-bot2@tip-bot2
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] objtool: Add missing endianess conversion when checking annations
2025-07-02 8:38 ` Peter Zijlstra
@ 2025-07-02 10:03 ` Sven Schnelle
0 siblings, 0 replies; 5+ messages in thread
From: Sven Schnelle @ 2025-07-02 10:03 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Josh Poimboeuf, linux-kernel, Alexander Gordeev
Peter Zijlstra <peterz@infradead.org> writes:
> On Wed, Jul 02, 2025 at 10:30:51AM +0200, Sven Schnelle wrote:
>> Sven Schnelle <svens@linux.ibm.com> writes:
>>
>> > 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.
>> >
>> > Fixes: 2116b349e29a ("objtool: Generic annotation infrastructure")
>> > Reported-by: Alexander Gordeev <agordeev@linux.ibm.com>
>> > Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
>> > ---
>> > tools/objtool/check.c | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/tools/objtool/check.c b/tools/objtool/check.c
>> > index b21b12ec88d9..35fb871b2c62 100644
>> > --- a/tools/objtool/check.c
>> > +++ b/tools/objtool/check.c
>> > @@ -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?
>
> 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!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-07-02 10:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-14 13:35 [PATCH] objtool: Add missing endianess conversion when checking annations Sven Schnelle
2025-05-14 16:13 ` Alexander Gordeev
2025-07-02 8:30 ` Sven Schnelle
2025-07-02 8:38 ` Peter Zijlstra
2025-07-02 10:03 ` Sven Schnelle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.