From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32023 invoked by alias); 20 Apr 2006 14:33:05 -0000 Received: (qmail 32013 invoked by uid 22791); 20 Apr 2006 14:33:04 -0000 X-Spam-Check-By: sourceware.org Received: from mail-out3.apple.com (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Apr 2006 14:32:58 +0000 Received: from relay6.apple.com (a17-128-113-36.apple.com [17.128.113.36]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id k3KEW9AK020867; Thu, 20 Apr 2006 07:32:09 -0700 (PDT) Received: from [17.201.26.242] (unknown [17.201.26.242]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by relay6.apple.com (Apple SCV relay) with ESMTP id 8A6C223C; Thu, 20 Apr 2006 07:32:09 -0700 (PDT) In-Reply-To: <000201c66486$d17663b0$ad00a8c0@amarnath> References: <000201c66486$d17663b0$ad00a8c0@amarnath> Mime-Version: 1.0 (Apple Message framework v749.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <9AF61D1A-506A-4F5A-99CC-0E0E6F91FEB0@apple.com> Cc: binutils@sources.redhat.com Content-Transfer-Encoding: 7bit From: Eric Christopher Subject: Re: Query in MIPS HI and LO relocations Date: Thu, 20 Apr 2006 15:36:00 -0000 To: Amarnath X-Mailer: Apple Mail (2.749.3) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00283.txt.bz2 On Apr 20, 2006, at 7:29 AM, Amarnath wrote: > Hi all, > > I am having a query in the MIPS ABI. As per the SYSTEM V ABI, > R_MIPS_HI16 relocation should be immediately followed by its > corresponding R_MIPS_LO16. > > I would like to know whether this is specific to SYSTEM V architecture > alone / the linker specification can be changed as per our own > architecture. You're free to do whatever you want. I'd look at some of the comments in elfxx-mips.c for guidance, e.g. /* The combined value is the sum of the HI16 addend, left-shifted by sixteen bits, and the LO16 addend, sign extended. (Usually, the code does a `lui' of the HI16 value, and then an `addiu' of the LO16 value.) Scan ahead to find a matching LO16 relocation. According to the MIPS ELF ABI, the R_MIPS_LO16 relocation must be immediately following. However, for the IRIX6 ABI, the next relocation may be a composed relocation consisting of several relocations for the same address. In that case, the R_MIPS_LO16 relocation may occur as one of these. We permit a similar extension in general, as that is useful for GCC. */ -eric