diff mbox series

[3/3] modpost: rename R_ARM_THM_CALL to R_ARM_THM_PC22

Message ID 20240704134812.1511315-3-masahiroy@kernel.org (mailing list archive)
State New
Headers show
Series [1/3] kbuild: raise the minimum GNU Make requirement to 4.0 | expand

Commit Message

Masahiro Yamada July 4, 2024, 1:47 p.m. UTC
R_ARM_THM_CALL does not exist in /usr/include/elf.h, which originates
from the Glibc project.

Instead, the following line exists:

  #define R_ARM_THM_PC22          10      /* PC relative 24 bit (Thumb32 BL).  */

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/mod/modpost.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Nathan Chancellor July 5, 2024, 5 p.m. UTC | #1
On Thu, Jul 04, 2024 at 10:47:57PM +0900, Masahiro Yamada wrote:
> R_ARM_THM_CALL does not exist in /usr/include/elf.h, which originates
> from the Glibc project.
> 
> Instead, the following line exists:
> 
>   #define R_ARM_THM_PC22          10      /* PC relative 24 bit (Thumb32 BL).  */
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Like I point out on patch 2, I think making this change a pure rename
and moving the removal into the patch that removes the rest of the
defines would probably be a little better but that's up to you.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
> 
>  scripts/mod/modpost.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index e9aae1b7ff77..3e5313ed6065 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -1168,10 +1168,6 @@ static Elf_Addr addend_386_rel(uint32_t *location, unsigned int r_type)
>  	return (Elf_Addr)(-1);
>  }
>  
> -#ifndef	R_ARM_THM_CALL
> -#define	R_ARM_THM_CALL		10
> -#endif
> -
>  static int32_t sign_extend32(int32_t value, int index)
>  {
>  	uint8_t shift = 31 - index;
> @@ -1232,7 +1228,7 @@ static Elf_Addr addend_arm_rel(void *loc, Elf_Sym *sym, unsigned int r_type)
>  				       ((lower & 0x07ff) << 1),
>  				       20);
>  		return offset + sym->st_value + 4;
> -	case R_ARM_THM_CALL:
> +	case R_ARM_THM_PC22:
>  	case R_ARM_THM_JUMP24:
>  		/*
>  		 * Encoding T4:
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index e9aae1b7ff77..3e5313ed6065 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1168,10 +1168,6 @@  static Elf_Addr addend_386_rel(uint32_t *location, unsigned int r_type)
 	return (Elf_Addr)(-1);
 }
 
-#ifndef	R_ARM_THM_CALL
-#define	R_ARM_THM_CALL		10
-#endif
-
 static int32_t sign_extend32(int32_t value, int index)
 {
 	uint8_t shift = 31 - index;
@@ -1232,7 +1228,7 @@  static Elf_Addr addend_arm_rel(void *loc, Elf_Sym *sym, unsigned int r_type)
 				       ((lower & 0x07ff) << 1),
 				       20);
 		return offset + sym->st_value + 4;
-	case R_ARM_THM_CALL:
+	case R_ARM_THM_PC22:
 	case R_ARM_THM_JUMP24:
 		/*
 		 * Encoding T4: