summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorKoakuma <koachan@protonmail.com>2025-06-09 20:53:11 +0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-07 06:08:14 +0900
commit3ece871e9c513e5a2c4ca0f08757ddb114a28df8 (patch)
tree8990cf257ffe3f2abf5afc1d02aa9b47c6f4cf77 /arch
parentd5dbe92ac8a4ca6226093241f95f9cb1b0d2e0e1 (diff)
downloadlinux-3ece871e9c513e5a2c4ca0f08757ddb114a28df8.tar.gz
linux-3ece871e9c513e5a2c4ca0f08757ddb114a28df8.tar.bz2
linux-3ece871e9c513e5a2c4ca0f08757ddb114a28df8.zip
sparc/module: Add R_SPARC_UA64 relocation handling
[ 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>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/include/asm/elf_64.h1
-rw-r--r--arch/sparc/kernel/module.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h
index 7e078bc73ef5..d3dda47d0bc5 100644
--- a/arch/sparc/include/asm/elf_64.h
+++ b/arch/sparc/include/asm/elf_64.h
@@ -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
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index df39580f398d..737f7a5c2835 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -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;