Skip to contentSkip to conversation

m32r: test below 0 on unsigned relocation

PATCH In review roel kluin 1 participant 1 message Jul 22, 2008

lore
Share & tools
lore

roel kluin

author
#0 lore raw

PATCH 7/9 m32r: test below 0 on unsigned relocation

Elf32_Addr relocation is unsigned so the test doesn't work.

---

arch/m32r/kernel/module.c +2 -2
index 8d42057..0af86f9 100644
@@ -172,7 +172,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
 			break;
 		case R_M32R_18_PCREL_RELA:
 	  		relocation = (relocation - (Elf32_Addr) location);
-			if (relocation < -0x20000 || 0x1fffc < relocation)
+			if (relocation > 0x1fffc)
 				{
 					printk(KERN_ERR "module %s: relocation overflow: %u\n",
 					me->name, relocation);
@@ -204,7 +204,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
 			break;
 		case R_M32R_26_PCREL_RELA:
 	  		relocation = (relocation - (Elf32_Addr) location);
-			if (relocation < -0x2000000 || 0x1fffffc < relocation)
+			if (relocation > 0x1fffffc)
 				{
 					printk(KERN_ERR "module %s: relocation overflow: %u\n",
 					me->name, relocation);