linux-stable/arch/alpha
Edward Humes 3415ad5a13 alpha: fix R_ALPHA_LITERAL reloc for large modules
[ Upstream commit b6b17a8b3e ]

Previously, R_ALPHA_LITERAL relocations would overflow for large kernel
modules.

This was because the Alpha's apply_relocate_add was relying on the kernel's
module loader to have sorted the GOT towards the very end of the module as it
was mapped into memory in order to correctly assign the global pointer. While
this behavior would mostly work fine for small kernel modules, this approach
would overflow on kernel modules with large GOT's since the global pointer
would be very far away from the GOT, and thus, certain entries would be out of
range.

This patch fixes this by instead using the Tru64 behavior of assigning the
global pointer to be 32KB away from the start of the GOT. The change made
in this patch won't work for multi-GOT kernel modules as it makes the
assumption the module only has one GOT located at the beginning of .got,
although for the vast majority kernel modules, this should be fine. Of the
kernel modules that would previously result in a relocation error, none of
them, even modules like nouveau, have even come close to filling up a single
GOT, and they've all worked fine under this patch.

Signed-off-by: Edward Humes <aurxenon@lunos.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-17 08:58:02 +01:00
..
boot alpha/boot/tools/objstrip: fix the check for ELF header 2023-03-10 09:28:48 +01:00
configs treewide: defconfig: address renamed CONFIG_DEBUG_INFO=y 2022-09-11 21:55:05 -07:00
include MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
kernel alpha: fix R_ALPHA_LITERAL reloc for large modules 2023-03-17 08:58:02 +01:00
lib net: unexport csum_and_copy_{from,to}_user 2022-04-29 14:37:59 -07:00
math-emu alpha: move __udiv_qrnnd library function to arch/alpha/lib/ 2021-09-18 14:45:48 -07:00
mm alpha/mm: enable ARCH_HAS_VM_GET_PAGE_PROT 2022-07-17 17:14:39 -07:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig mm/mmap: drop ARCH_HAS_VM_GET_PAGE_PROT 2022-07-17 17:14:41 -07:00
Kconfig.debug treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile kbuild: remove head-y syntax 2022-10-02 18:06:03 +09:00