From 3b7501ef4add9725f25f6446890def03416a69d7 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 19 Jan 2004 05:10:48 -0800 Subject: [PATCH] [PATCH] Relocation overflow with modules on Alpha From: Ivan Kokshaysky Larger modules fail to load with the message "Relocation overflow vs section 17", or some other section number. This failure happens with GPRELHIGH relocation, which is *signed* short, but relocation overflow check in module.c doesn't take into account the sign extension. --- arch/alpha/kernel/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c index 425928769c1d5..db7a87791efa8 100644 --- a/arch/alpha/kernel/module.c +++ b/arch/alpha/kernel/module.c @@ -259,7 +259,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, *(u64 *)location = value; break; case R_ALPHA_GPRELHIGH: - value = (value - gp + 0x8000) >> 16; + value = (long)(value - gp + 0x8000) >> 16; if ((short) value != value) goto reloc_overflow; *(u16 *)location = value; -- 2.53.0