linux-mips
[Top] [All Lists]

Re: regarding jal instruction in mips

To: aditya <aditya.ps@ap.sony.com>
Subject: Re: regarding jal instruction in mips
From: Dominic Sweetman <dom@algor.co.uk>
Date: Mon, 17 Jun 2002 12:17:03 +0100 (BST)
Cc: linux-mips@oss.sgi.com
In-reply-to: <4.3.2.7.0.20020617140608.00b9f640@43.88.102.8>
References: <4.3.2.7.0.20020617140608.00b9f640@43.88.102.8>
Sender: owner-linux-mips@oss.sgi.com
aditya (aditya.ps@ap.sony.com) writes:

> I have a doubt w.r.t. Linux on mips.
> 
> in mips there is a instruction jal which jumps across 256 MB
> boundry.  but this is a restriction as shared text (libraries) and
> private text (program's text) should be located within 256 MB
> boundry. Is it true ??

In the usual Linux address map it isn't true: library code might
easily fail to be in the same 256Mbyte 'chunk' of virtual memory.

Linux/MIPS applications implement calls between modules (and for
relocatable libraries, calls inside modules too) with an indirection
through a table of pointers - the "global access table" or GOT.

We normally think of this as a way of providing suitably
position-independent code...  There's a fair description of this in my
book "See MIPS Run" under the heading "Sharing Library Code in the
MIPS ABI" - Chapter 10 or so.

-- 
Dominic Sweetman, 
Algorithmics Ltd
The Fruit Farm, Ely Road, Chittering, CAMBS CB5 9PH, ENGLAND
phone: +44 1223 706200 / fax: +44 1223 706250 / direct: +44 1223 706205
http://www.algor.co.uk

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