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

From: roel kluin
Date: Mon Jul 21 2008 - 20:31:01 EST


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

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
diff --git a/arch/m32r/kernel/module.c b/arch/m32r/kernel/module.c
index 8d42057..0af86f9 100644
--- a/arch/m32r/kernel/module.c
+++ b/arch/m32r/kernel/module.c
@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/