]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
sparc/module: Add R_SPARC_UA64 relocation handling
authorKoakuma <koachan@protonmail.com>
Mon, 9 Jun 2025 13:53:11 +0000 (20:53 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 11:45:13 +0000 (12:45 +0100)
[ Upstream commit 05457d96175d25c976ab6241c332ae2eb5e07833 ]

This is needed so that the kernel can handle R_SPARC_UA64 relocations,
which is emitted by LLVM's IAS.

Signed-off-by: Koakuma <koachan@protonmail.com>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/sparc/include/asm/elf_64.h
arch/sparc/kernel/module.c

index 7e078bc73ef5616d8f0a94f070246d203c4f6e14..d3dda47d0bc5a7459689af155f88e572afdd3101 100644 (file)
@@ -59,6 +59,7 @@
 #define R_SPARC_7              43
 #define R_SPARC_5              44
 #define R_SPARC_6              45
+#define R_SPARC_UA64           54
 
 /* Bits present in AT_HWCAP, primarily for Sparc32.  */
 #define HWCAP_SPARC_FLUSH       0x00000001
index df39580f398d3a6171fba5868b611d84bba7b8c6..737f7a5c28359168b6d635313eb29eccfb7dd412 100644 (file)
@@ -117,6 +117,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
                        break;
 #ifdef CONFIG_SPARC64
                case R_SPARC_64:
+               case R_SPARC_UA64:
                        location[0] = v >> 56;
                        location[1] = v >> 48;
                        location[2] = v >> 40;