mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] objtool: fix failure when being compiled on x32 system
@ 2025-10-20 12:23 Mikulas Patocka
  2025-10-20 12:38 ` Peter Zijlstra
  2025-10-22 13:28 ` [tip: objtool/urgent] objtool: Fix " tip-bot2 for Mikulas Patocka
  0 siblings, 2 replies; 6+ messages in thread
From: Mikulas Patocka @ 2025-10-20 12:23 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Borislav Petkov, Peter Zijlstra, Josh Poimboeuf,
	Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]

Fix compilation failure when compiling the kernel with the x32 toolchain.

In file included from check.c:16:
check.c: In function ‘check_abs_references’:
/usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:47:17: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘u64’ {aka ‘long
long unsigned int’} [-Werror=format=]
   47 |                 "%s%s%s: objtool" extra ": " format "\n",               \
      |                 ^~~~~~~~~~~~~~~~~
/usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:54:9: note: in expansion of macro ‘___WARN’
   54 |         ___WARN(severity, "", format, ##__VA_ARGS__)
      |         ^~~~~~~
/usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:74:27: note: in expansion of macro ‘__WARN’
   74 | #define WARN(format, ...) __WARN(WARN_STR, format, ##__VA_ARGS__)
      |                           ^~~~~~
check.c:4713:33: note: in expansion of macro ‘WARN’
 4713 |                                 WARN("section %s has absolute relocation at offset 0x%lx",
      |                                 ^~~~

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 0d6e4563fc03 ("objtool: Add action to check for absence of absolute relocations")

---
 tools/objtool/check.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/tools/objtool/check.c
===================================================================
--- linux-2.6.orig/tools/objtool/check.c	2025-10-13 21:42:48.000000000 +0200
+++ linux-2.6/tools/objtool/check.c	2025-10-13 21:48:33.000000000 +0200
@@ -4710,8 +4710,8 @@ static int check_abs_references(struct o
 
 		for_each_reloc(sec->rsec, reloc) {
 			if (arch_absolute_reloc(file->elf, reloc)) {
-				WARN("section %s has absolute relocation at offset 0x%lx",
-				     sec->name, reloc_offset(reloc));
+				WARN("section %s has absolute relocation at offset 0x%llx",
+				     sec->name, (unsigned long long)reloc_offset(reloc));
 				ret++;
 			}
 		}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] objtool: fix failure when being compiled on x32 system
  2025-10-20 12:23 [PATCH] objtool: fix failure when being compiled on x32 system Mikulas Patocka
@ 2025-10-20 12:38 ` Peter Zijlstra
  2025-10-22 13:28 ` [tip: objtool/urgent] objtool: Fix " tip-bot2 for Mikulas Patocka
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Zijlstra @ 2025-10-20 12:38 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Ard Biesheuvel, Borislav Petkov, Josh Poimboeuf,
	Linux Kernel Mailing List

On Mon, Oct 20, 2025 at 02:23:58PM +0200, Mikulas Patocka wrote:
> Fix compilation failure when compiling the kernel with the x32 toolchain.
> 
> In file included from check.c:16:
> check.c: In function ‘check_abs_references’:
> /usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:47:17: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘u64’ {aka ‘long
> long unsigned int’} [-Werror=format=]
>    47 |                 "%s%s%s: objtool" extra ": " format "\n",               \
>       |                 ^~~~~~~~~~~~~~~~~
> /usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:54:9: note: in expansion of macro ‘___WARN’
>    54 |         ___WARN(severity, "", format, ##__VA_ARGS__)
>       |         ^~~~~~~
> /usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:74:27: note: in expansion of macro ‘__WARN’
>    74 | #define WARN(format, ...) __WARN(WARN_STR, format, ##__VA_ARGS__)
>       |                           ^~~~~~
> check.c:4713:33: note: in expansion of macro ‘WARN’
>  4713 |                                 WARN("section %s has absolute relocation at offset 0x%lx",
>       |                                 ^~~~
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Fixes: 0d6e4563fc03 ("objtool: Add action to check for absence of absolute relocations")

You could've kept Ard's Ack. I'll go add it manually.

Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip: objtool/urgent] objtool: Fix failure when being compiled on x32 system
  2025-10-20 12:23 [PATCH] objtool: fix failure when being compiled on x32 system Mikulas Patocka
  2025-10-20 12:38 ` Peter Zijlstra
@ 2025-10-22 13:28 ` tip-bot2 for Mikulas Patocka
  1 sibling, 0 replies; 6+ messages in thread
From: tip-bot2 for Mikulas Patocka @ 2025-10-22 13:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Mikulas Patocka, Peter Zijlstra (Intel),
	Ard Biesheuvel, x86, linux-kernel

The following commit has been merged into the objtool/urgent branch of tip:

Commit-ID:     49c98f30f4021b560676a336f8a46a4f642eee2b
Gitweb:        https://git.kernel.org/tip/49c98f30f4021b560676a336f8a46a4f642eee2b
Author:        Mikulas Patocka <mpatocka@redhat.com>
AuthorDate:    Mon, 20 Oct 2025 14:23:58 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 22 Oct 2025 15:21:55 +02:00

objtool: Fix failure when being compiled on x32 system

Fix compilation failure when compiling the kernel with the x32 toolchain.

In file included from check.c:16:
check.c: In function ¡check_abs_references¢:
/usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:47:17: error: format ¡%lx¢ expects argument of type ¡long unsigned int¢, but argument 7 has type ¡u64¢ {aka ¡long
long unsigned int¢} [-Werror=format=]
   47 |                 "%s%s%s: objtool" extra ": " format "\n",               \
      |                 ^~~~~~~~~~~~~~~~~
/usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:54:9: note: in expansion of macro ¡___WARN¢
   54 |         ___WARN(severity, "", format, ##__VA_ARGS__)
      |         ^~~~~~~
/usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:74:27: note: in expansion of macro ¡__WARN¢
   74 | #define WARN(format, ...) __WARN(WARN_STR, format, ##__VA_ARGS__)
      |                           ^~~~~~
check.c:4713:33: note: in expansion of macro ¡WARN¢
 4713 |                                 WARN("section %s has absolute relocation at offset 0x%lx",
      |                                 ^~~~

Fixes: 0d6e4563fc03 ("objtool: Add action to check for absence of absolute relocations")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://patch.msgid.link/1ac32fff-2e67-5155-f570-69aad5bf5412@redhat.com
---
 tools/objtool/check.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 3c7ab91..620854f 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4711,8 +4711,8 @@ static int check_abs_references(struct objtool_file *file)
 
 		for_each_reloc(sec->rsec, reloc) {
 			if (arch_absolute_reloc(file->elf, reloc)) {
-				WARN("section %s has absolute relocation at offset 0x%lx",
-				     sec->name, reloc_offset(reloc));
+				WARN("section %s has absolute relocation at offset 0x%llx",
+				     sec->name, (unsigned long long)reloc_offset(reloc));
 				ret++;
 			}
 		}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] objtool: fix failure when being compiled on x32 system
  2025-10-15 15:56   ` Josh Poimboeuf
@ 2025-10-20 12:24     ` Mikulas Patocka
  0 siblings, 0 replies; 6+ messages in thread
From: Mikulas Patocka @ 2025-10-20 12:24 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Ard Biesheuvel, Linux Kernel Mailing List, Borislav Petkov,
	Peter Zijlstra



On Wed, 15 Oct 2025, Josh Poimboeuf wrote:

> On Tue, Oct 14, 2025 at 09:33:08AM +0200, Ard Biesheuvel wrote:
> > (cc lkml)
> 
> Can you resend the patch and copy lkml?

OK, I've resent it.

Mikulas


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] objtool: fix failure when being compiled on x32 system
  2025-10-14  7:33 ` [PATCH] objtool: fix " Ard Biesheuvel
@ 2025-10-15 15:56   ` Josh Poimboeuf
  2025-10-20 12:24     ` Mikulas Patocka
  0 siblings, 1 reply; 6+ messages in thread
From: Josh Poimboeuf @ 2025-10-15 15:56 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Mikulas Patocka, Linux Kernel Mailing List, Borislav Petkov,
	Peter Zijlstra

On Tue, Oct 14, 2025 at 09:33:08AM +0200, Ard Biesheuvel wrote:
> (cc lkml)

Can you resend the patch and copy lkml?

> On Mon, 13 Oct 2025 at 22:21, Mikulas Patocka <mpatocka@redhat.com> wrote:
> >
> > Fix compilation failure when compiling the kernel with the x32 toolchain.
> >
> > In file included from check.c:16:
> > check.c: In function ‘check_abs_references’:
> > /usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:47:17: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘u64’ {aka ‘long
> > long unsigned int’} [-Werror=format=]
> >    47 |                 "%s%s%s: objtool" extra ": " format "\n",               \
> >       |                 ^~~~~~~~~~~~~~~~~
> > /usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:54:9: note: in expansion of macro ‘___WARN’
> >    54 |         ___WARN(severity, "", format, ##__VA_ARGS__)
> >       |         ^~~~~~~
> > /usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:74:27: note: in expansion of macro ‘__WARN’
> >    74 | #define WARN(format, ...) __WARN(WARN_STR, format, ##__VA_ARGS__)
> >       |                           ^~~~~~
> > check.c:4713:33: note: in expansion of macro ‘WARN’
> >  4713 |                                 WARN("section %s has absolute relocation at offset 0x%lx",
> >       |                                 ^~~~
> >
> > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> > Fixes: 0d6e4563fc03 ("objtool: Add action to check for absence of absolute relocations")
> >
> > ---
> >  tools/objtool/check.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Index: linux-2.6/tools/objtool/check.c
> > ===================================================================
> > --- linux-2.6.orig/tools/objtool/check.c        2025-10-13 21:42:48.000000000 +0200
> > +++ linux-2.6/tools/objtool/check.c     2025-10-13 21:48:33.000000000 +0200
> > @@ -4710,8 +4710,8 @@ static int check_abs_references(struct o
> >
> >                 for_each_reloc(sec->rsec, reloc) {
> >                         if (arch_absolute_reloc(file->elf, reloc)) {
> > -                               WARN("section %s has absolute relocation at offset 0x%lx",
> > -                                    sec->name, reloc_offset(reloc));
> > +                               WARN("section %s has absolute relocation at offset 0x%llx",
> > +                                    sec->name, (unsigned long long)reloc_offset(reloc));
> >                                 ret++;
> >                         }
> >                 }
> 
> Acked-by: Ard Biesheuvel <ardb@kernel.org>

-- 
Josh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] objtool: fix failure when being compiled on x32 system
       [not found] <f80021c8-f8e1-9ed2-4791-705c4d7b7b8a@redhat.com>
@ 2025-10-14  7:33 ` Ard Biesheuvel
  2025-10-15 15:56   ` Josh Poimboeuf
  0 siblings, 1 reply; 6+ messages in thread
From: Ard Biesheuvel @ 2025-10-14  7:33 UTC (permalink / raw)
  To: Mikulas Patocka, Linux Kernel Mailing List
  Cc: Borislav Petkov, Peter Zijlstra, Josh Poimboeuf

(cc lkml)

On Mon, 13 Oct 2025 at 22:21, Mikulas Patocka <mpatocka@redhat.com> wrote:
>
> Fix compilation failure when compiling the kernel with the x32 toolchain.
>
> In file included from check.c:16:
> check.c: In function ‘check_abs_references’:
> /usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:47:17: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘u64’ {aka ‘long
> long unsigned int’} [-Werror=format=]
>    47 |                 "%s%s%s: objtool" extra ": " format "\n",               \
>       |                 ^~~~~~~~~~~~~~~~~
> /usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:54:9: note: in expansion of macro ‘___WARN’
>    54 |         ___WARN(severity, "", format, ##__VA_ARGS__)
>       |         ^~~~~~~
> /usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:74:27: note: in expansion of macro ‘__WARN’
>    74 | #define WARN(format, ...) __WARN(WARN_STR, format, ##__VA_ARGS__)
>       |                           ^~~~~~
> check.c:4713:33: note: in expansion of macro ‘WARN’
>  4713 |                                 WARN("section %s has absolute relocation at offset 0x%lx",
>       |                                 ^~~~
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Fixes: 0d6e4563fc03 ("objtool: Add action to check for absence of absolute relocations")
>
> ---
>  tools/objtool/check.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Index: linux-2.6/tools/objtool/check.c
> ===================================================================
> --- linux-2.6.orig/tools/objtool/check.c        2025-10-13 21:42:48.000000000 +0200
> +++ linux-2.6/tools/objtool/check.c     2025-10-13 21:48:33.000000000 +0200
> @@ -4710,8 +4710,8 @@ static int check_abs_references(struct o
>
>                 for_each_reloc(sec->rsec, reloc) {
>                         if (arch_absolute_reloc(file->elf, reloc)) {
> -                               WARN("section %s has absolute relocation at offset 0x%lx",
> -                                    sec->name, reloc_offset(reloc));
> +                               WARN("section %s has absolute relocation at offset 0x%llx",
> +                                    sec->name, (unsigned long long)reloc_offset(reloc));
>                                 ret++;
>                         }
>                 }

Acked-by: Ard Biesheuvel <ardb@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-10-22 13:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-20 12:23 [PATCH] objtool: fix failure when being compiled on x32 system Mikulas Patocka
2025-10-20 12:38 ` Peter Zijlstra
2025-10-22 13:28 ` [tip: objtool/urgent] objtool: Fix " tip-bot2 for Mikulas Patocka
     [not found] <f80021c8-f8e1-9ed2-4791-705c4d7b7b8a@redhat.com>
2025-10-14  7:33 ` [PATCH] objtool: fix " Ard Biesheuvel
2025-10-15 15:56   ` Josh Poimboeuf
2025-10-20 12:24     ` Mikulas Patocka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®