lkml.org 
[lkml]   [2008]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] m32r: test before subtraction on unsigned relocation range
From: Roel Kluin <12o3l@tiscali.nl>
Subject: [PATCH] m32r: test before subtraction on unsigned relocation range
Date: Wed, 23 Apr 2008 18:34:16 +0200
> case R_M32R_26_PCREL_RELA:
> - relocation = (relocation - (Elf32_Addr) location);
> - if (relocation < -0x2000000 || 0x1fffffc < relocation)
> + if (relocation + 0x20000 < (Elf32_Addr) location ||
> + relocation >= 0x1fffc + (Elf32_Addr) location)

A slight fix is required.

The above range check is incorrect, because the R_M32R_26_PCREL_RELA is
26-bit relocation.

-- Takata


\
 
 \ /
  Last update: 2008-04-25 04:39    [W:0.281 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site