linux-mips
[Top] [All Lists]

Re: Strange gp corruption problem

To: Mike Crowe <mac@mcrowe.com>
Subject: Re: Strange gp corruption problem
From: Thiemo Seufer <ths@networkno.de>
Date: Thu, 12 Jul 2007 18:21:52 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <20070712170624.GA31776@mcrowe.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20070712170624.GA31776@mcrowe.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.16 (2007-06-11)
Mike Crowe wrote:
[snip]
> We have a function that does some string manipulation (not
> particularly dangerous manipulation and I've been through it
> carefully) and then calls atol. As expected the prologue of this
> function calculates the value of the gp register by applying an offset
> to the t9 register which contains the address of the start of the
> function like this:
> 
>  47995c:       3c1c0fba        lui     gp,0xfba

Looks weird as an entry point. Normally entries are 8 byte aligned.

[snip]
> The only user-space reason I can come up with for this happening is if
> the caller jumped into this function one instruction late. This seems
> unlikely because t9 contains the correct value and the stack looks
> fine.

Check the value of $ra (e.g. with a gdb breakpoint) after entering the
function.


Thiemo

<Prev in Thread] Current Thread [Next in Thread>