Messages in this thread Patch in this message | | | Date | Mon, 21 Jul 2008 20:29:39 -0400 | From | roel kluin <> | Subject | [PATCH 7/9] m32r: test below 0 on unsigned relocation |
| |
Elf32_Addr relocation is unsigned so the test doesn't work.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com> --- 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);
| |