[Top] [All Lists]

Re: Setting gp on pic code

To: Alex Gonzalez <>
Subject: Re: Setting gp on pic code
From: Brett Foster <>
Date: Mon, 16 Jan 2006 07:11:53 -0500
Cc: linux-mips <>
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
Alex Gonzalez wrote:


I am trying to set the gp register on pic code as follows:

"la gp,_gp"

Disassembling the resulting code,

"lw gp,0(gp)"
Yes, this is normal... Use the following to set up the GP:
       //init GP
       lui     gp,%HI(_gp)
       ori     gp,%LO(_gp)

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