Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5f12503 authored by Kevin Welton's avatar Kevin Welton Committed by Russell King
Browse files

[ARM] Fix ARM branch relocation range



Branches in the ARM architecture are restricted to a range of +/- 32MB.
However, the code in .../arch/arm/kernel/module.c::apply_relocate() was
checking offset against a range of +/- 64MB.

Signed-off-by: default avatarKevin Welton <Kevin.Welton@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 8678c1f0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -116,8 +116,8 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,

			offset += sym->st_value - loc;
			if (offset & 3 ||
			    offset <= (s32)0xfc000000 ||
			    offset >= (s32)0x04000000) {
			    offset <= (s32)0xfe000000 ||
			    offset >= (s32)0x02000000) {
				printk(KERN_ERR
				       "%s: relocation out of range, section "
				       "%d reloc %d sym '%s'\n", module->name,