Commit 3b7501ef authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Relocation overflow with modules on Alpha

From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>

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.
parent 21c7c9d2
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment