public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 7/9] m32r: test below 0 on unsigned relocation
@ 2008-07-22  0:29 roel kluin
  0 siblings, 0 replies; only message in thread
From: roel kluin @ 2008-07-22  0:29 UTC (permalink / raw)
  To: takata, linux-m32r; +Cc: linux-kernel

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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-22  0:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-22  0:29 [PATCH 7/9] m32r: test below 0 on unsigned relocation roel kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox