From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19086 invoked by alias); 11 Jun 2006 00:42:25 -0000 Received: (qmail 19076 invoked by uid 22791); 11 Jun 2006 00:42:25 -0000 X-Spam-Check-By: sourceware.org Received: from bender.bawue.de (HELO bender.bawue.de) (193.7.176.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 11 Jun 2006 00:42:23 +0000 Received: from lagash (88-106-172-197.dynamic.dsl.as9105.com [88.106.172.197]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by bender.bawue.de (Postfix) with ESMTP id 5549D44EC1; Sun, 11 Jun 2006 02:42:21 +0200 (MEST) Received: from ths by lagash with local (Exim 4.62) (envelope-from ) id 1FpE1x-0006Jt-9x; Sun, 11 Jun 2006 01:42:17 +0100 Date: Sun, 11 Jun 2006 08:21:00 -0000 From: Thiemo Seufer To: Eric Christopher Cc: David Daney , binutils@sourceware.org, Daniel Jacobowitz , richard@codesourcery.com Subject: Re: [PATCH] (version 2) Change MIPS linker stubs to allow for more than 2^15 symbols. Message-ID: <20060611004217.GA24131@networkno.de> References: <4488A29D.5040100@avtrex.com> <87hd2ukeb2.fsf@talisman.home> <20060609154619.GB12079@networkno.de> <87hd2um83b.fsf@talisman.home> <87pshhpaf3.fsf@talisman.home> <20060611000745.GF12079@networkno.de> <580DB08B-162D-4820-907A-281E56B14BDC@apple.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <580DB08B-162D-4820-907A-281E56B14BDC@apple.com> User-Agent: Mutt/1.5.11+cvs20060403 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-06/txt/msg00160.txt.bz2 Eric Christopher wrote: > I usually prefer this style: > > >-#define STUB_LUI(VAL) (0x3c180000 + (VAL)) /* lui t8,VAL */ plus >- bfd_put_32 (output_bfd, STUB_LUI ((h->dynindx >> 16) & 0x7fff), >- stub + idx); >- idx += 4; or rather: >-/* Instructions which appear in a stub. */ >-#define STUB_LW(abfd) \ >- ((ABI_64_P (abfd) \ >- ? 0xdf998010 /* ld t9,0x8010(gp) */ \ >- : 0x8f998010)) /* lw t9,0x8010(gp) */ plus >- idx = 0; >- bfd_put_32 (output_bfd, STUB_LW (output_bfd), stub + idx); elsewhere ... > To this... > > >+ /* Fill the stub. */ > >+ bfd_put_32 (output_bfd, (ABI_64_P (output_bfd) > >+ ? 0xdf998010 /* ld t9, 0x8010(gp) */ > >+ : 0x8f998010), /* lw t9, 0x8010(gp) */ > >+ stub); All those macros are only used once, so I prefer to have the information in a single place in the file. Thiemo