mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts/mod/modpost: For CentOS 7/old binutils compatibility
@ 2025-07-28 16:19 Haoran lee
  2025-08-07 10:51 ` Nicolas Schier
  0 siblings, 1 reply; 5+ messages in thread
From: Haoran lee @ 2025-07-28 16:19 UTC (permalink / raw)
  To: masahiroy; +Cc: nathan, nicolas.schier, linux-kbuild, linux-kernel

From fcf92a8a85884b383872fb435fef008fc794c3bb Mon Sep 17 00:00:00 2001
From: houranled <leegit@163.com>
Date: Mon, 28 Jul 2025 23:54:57 +0800
Subject: [PATCH] CentOS 7 / old binutils compatibility

Signed-off-by: Haoran Lee <470658536@qq.com>
---
 scripts/mod/modpost.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 5ca7c268294e..216647e2f301 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -30,6 +30,32 @@
 
 #define MODULE_NS_PREFIX "module:"
 
+/* CentOS 7 / old binutils compatibility */
+#ifndef R_ARM_MOVW_ABS_NC
+#define R_ARM_MOVW_ABS_NC       43
+#endif
+#ifndef R_ARM_MOVT_ABS
+#define R_ARM_MOVT_ABS          44
+#endif
+#ifndef R_ARM_THM_MOVW_ABS_NC
+#define R_ARM_THM_MOVW_ABS_NC   47
+#endif
+#ifndef R_ARM_THM_MOVT_ABS
+#define R_ARM_THM_MOVT_ABS      48
+#endif
+#ifndef R_ARM_CALL
+#define R_ARM_CALL              28
+#endif
+#ifndef R_ARM_JUMP24
+#define R_ARM_JUMP24            29
+#endif
+#ifndef R_ARM_THM_JUMP19
+#define R_ARM_THM_JUMP19        51
+#endif
+#ifndef R_ARM_THM_JUMP24
+#define R_ARM_THM_JUMP24        30
+#endif
+
 static bool module_enabled;
 /* Are we using CONFIG_MODVERSIONS? */
 static bool modversions;
-- 
2.43.0


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

* Re: [PATCH] scripts/mod/modpost: For CentOS 7/old binutils compatibility
  2025-07-28 16:19 [PATCH] scripts/mod/modpost: For CentOS 7/old binutils compatibility Haoran lee
@ 2025-08-07 10:51 ` Nicolas Schier
  2025-08-07 16:22   ` Nathan Chancellor
  2025-08-08  3:06   ` Haoran lee
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolas Schier @ 2025-08-07 10:51 UTC (permalink / raw)
  To: Haoran lee; +Cc: masahiroy, nathan, linux-kbuild, linux-kernel

On Tue, Jul 29, 2025 at 12:19:46AM +0800, Haoran lee wrote:
> 
> Signed-off-by: Haoran Lee <470658536@qq.com>
> ---

Please note that empty commit descriptions will not be accepted.


>  scripts/mod/modpost.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 5ca7c268294e..216647e2f301 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -30,6 +30,32 @@
>  
>  #define MODULE_NS_PREFIX "module:"
>  
> +/* CentOS 7 / old binutils compatibility */

Since v6.16-rc1 the minimum binutils version has been lifted to 
binutils-2.30 [1].

Which binutils version do you have at CentOS 7 ?

Kind regards,
Nicolas


[1]: https://git.kernel.org/torvalds/c/118c40b7b50340bf7ff7e0adee8e3

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

* Re: [PATCH] scripts/mod/modpost: For CentOS 7/old binutils compatibility
  2025-08-07 10:51 ` Nicolas Schier
@ 2025-08-07 16:22   ` Nathan Chancellor
  2025-08-07 18:55     ` Nicolas Schier
  2025-08-08  3:06   ` Haoran lee
  1 sibling, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2025-08-07 16:22 UTC (permalink / raw)
  To: Nicolas Schier; +Cc: Haoran lee, masahiroy, linux-kbuild, linux-kernel

On Thu, Aug 07, 2025 at 12:51:59PM +0200, Nicolas Schier wrote:
> On Tue, Jul 29, 2025 at 12:19:46AM +0800, Haoran lee wrote:
> > 
> > Signed-off-by: Haoran Lee <470658536@qq.com>
> > ---
> 
> Please note that empty commit descriptions will not be accepted.

Agreed, a clear description of the issue (including an error message)
and logic of the fix is needed.

> >  scripts/mod/modpost.c | 26 ++++++++++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> > 
> > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> > index 5ca7c268294e..216647e2f301 100644
> > --- a/scripts/mod/modpost.c
> > +++ b/scripts/mod/modpost.c
> > @@ -30,6 +30,32 @@
> >  
> >  #define MODULE_NS_PREFIX "module:"
> >  
> > +/* CentOS 7 / old binutils compatibility */
> 
> Since v6.16-rc1 the minimum binutils version has been lifted to 
> binutils-2.30 [1].
> 
> [1]: https://git.kernel.org/torvalds/c/118c40b7b50340bf7ff7e0adee8e3
> 
> Which binutils version do you have at CentOS 7 ?

These values come from glibc's elf.h if I understand correctly, so I
think this is more about compatibility with versions of glibc that do
not have these relocations defined, rather than binutils.

It appears these were all added in glibc 2.18 over ten years ago [1],
whereas CentOS 7 appears to use glibc 2.17. There is some prior art to
adding elf.h constants to modpost.c when they are not defined by elf.h
but I am not sure if it is worth it in this case, as CentOS 7 has been
EOL for over a year at this point (and I suspect the binutils / GCC
version is already prohibitive for working on mainline).

If we do want to add these relocation defines, I think they should be
added in order of their numerical value. I do not have a strong opinion
either way.

[1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=08cbd996d33114ca50644d060fbe3a08260430fb

Cheers,
Nathan

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

* Re: [PATCH] scripts/mod/modpost: For CentOS 7/old binutils compatibility
  2025-08-07 16:22   ` Nathan Chancellor
@ 2025-08-07 18:55     ` Nicolas Schier
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Schier @ 2025-08-07 18:55 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: Haoran lee, masahiroy, linux-kbuild, linux-kernel

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

On Thu, Aug 07, 2025 at 09:22:38AM -0700 Nathan Chancellor wrote:
> On Thu, Aug 07, 2025 at 12:51:59PM +0200, Nicolas Schier wrote:
> > On Tue, Jul 29, 2025 at 12:19:46AM +0800, Haoran lee wrote:
> > > 
> > > Signed-off-by: Haoran Lee <470658536@qq.com>
> > > ---
> > 
> > Please note that empty commit descriptions will not be accepted.
> 
> Agreed, a clear description of the issue (including an error message)
> and logic of the fix is needed.
> 
> > >  scripts/mod/modpost.c | 26 ++++++++++++++++++++++++++
> > >  1 file changed, 26 insertions(+)
> > > 
> > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> > > index 5ca7c268294e..216647e2f301 100644
> > > --- a/scripts/mod/modpost.c
> > > +++ b/scripts/mod/modpost.c
> > > @@ -30,6 +30,32 @@
> > >  
> > >  #define MODULE_NS_PREFIX "module:"
> > >  
> > > +/* CentOS 7 / old binutils compatibility */
> > 
> > Since v6.16-rc1 the minimum binutils version has been lifted to 
> > binutils-2.30 [1].
> > 
> > [1]: https://git.kernel.org/torvalds/c/118c40b7b50340bf7ff7e0adee8e3
> > 
> > Which binutils version do you have at CentOS 7 ?
> 
> These values come from glibc's elf.h if I understand correctly, so I
> think this is more about compatibility with versions of glibc that do
> not have these relocations defined, rather than binutils.
> 
> It appears these were all added in glibc 2.18 over ten years ago [1],
> whereas CentOS 7 appears to use glibc 2.17. There is some prior art to
> adding elf.h constants to modpost.c when they are not defined by elf.h
> but I am not sure if it is worth it in this case, as CentOS 7 has been
> EOL for over a year at this point (and I suspect the binutils / GCC
> version is already prohibitive for working on mainline).

ah, look what I found: https://lore.kernel.org/linux-kbuild/20240704134812.1511315-2-masahiroy@kernel.org/

According repology.org, CentOS 7 brings gcc 4.8.5 while v6.16 requires at
least gcc 8.  I am pretty sure that this patch will not be sufficient for
re-adding support for CentOS 7 - I doubt that its worth the effort.

Kind regards,
Nicolas

> If we do want to add these relocation defines, I think they should be
> added in order of their numerical value. I do not have a strong opinion
> either way.
> 
> [1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=08cbd996d33114ca50644d060fbe3a08260430fb



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] scripts/mod/modpost: For CentOS 7/old binutils compatibility
  2025-08-07 10:51 ` Nicolas Schier
  2025-08-07 16:22   ` Nathan Chancellor
@ 2025-08-08  3:06   ` Haoran lee
  1 sibling, 0 replies; 5+ messages in thread
From: Haoran lee @ 2025-08-08  3:06 UTC (permalink / raw)
  To: Nicolas Schier; +Cc: masahiroy, nathan, linux-kbuild, linux-kernel

On Thu, Aug 07, 2025 at 12:51:59PM +0200, Nicolas Schier wrote:
> On Tue, Jul 29, 2025 at 12:19:46AM +0800, Haoran lee wrote:
> > 
> > Signed-off-by: Haoran Lee <470658536@qq.com>
> > ---
> 
> Please note that empty commit descriptions will not be accepted.
> 
> 
> >  scripts/mod/modpost.c | 26 ++++++++++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> > 
> > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> > index 5ca7c268294e..216647e2f301 100644
> > --- a/scripts/mod/modpost.c
> > +++ b/scripts/mod/modpost.c
> > @@ -30,6 +30,32 @@
> >  
> >  #define MODULE_NS_PREFIX "module:"
> >  
> > +/* CentOS 7 / old binutils compatibility */
> 
> Since v6.16-rc1 the minimum binutils version has been lifted to 
> binutils-2.30 [1].
> 
> Which binutils version do you have at CentOS 7 ?

Hi! This is my binutils and gcc version on my CentOS 7 system:

rpm -q binutils
binutils-2.27-44.base.el7_9.1.x86_64

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper
Target: x86_64-redhat-linux
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)


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

end of thread, other threads:[~2025-08-08  3:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-28 16:19 [PATCH] scripts/mod/modpost: For CentOS 7/old binutils compatibility Haoran lee
2025-08-07 10:51 ` Nicolas Schier
2025-08-07 16:22   ` Nathan Chancellor
2025-08-07 18:55     ` Nicolas Schier
2025-08-08  3:06   ` Haoran lee

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®