From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30319 invoked by alias); 25 Feb 2005 15:30:24 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 29702 invoked from network); 25 Feb 2005 15:30:09 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 25 Feb 2005 15:30:09 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j1PFU4Pt013245 for ; Fri, 25 Feb 2005 10:30:09 -0500 Received: from talisman.cambridge.redhat.com (talisman.cambridge.redhat.com [172.16.18.81]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j1PFU3K20979; Fri, 25 Feb 2005 10:30:03 -0500 Received: from talisman.cambridge.redhat.com (localhost.localdomain [127.0.0.1]) by talisman.cambridge.redhat.com (8.13.1/8.12.10) with ESMTP id j1PFTv4U005996; Fri, 25 Feb 2005 15:29:57 GMT Received: (from rsandifo@localhost) by talisman.cambridge.redhat.com (8.13.1/8.12.10/Submit) id j1PFTpBl005995; Fri, 25 Feb 2005 15:29:51 GMT X-Authentication-Warning: talisman.cambridge.redhat.com: rsandifo set sender to rsandifo@redhat.com using -f To: "Maciej W. Rozycki" Cc: binutils@sources.redhat.com Subject: Re: [patch] MIPS: Fix synthesized doubleword transfers (ping) References: <87sm3lhdo1.fsf@firetop.home> From: Richard Sandiford Date: Fri, 25 Feb 2005 16:12:00 -0000 In-Reply-To: <87sm3lhdo1.fsf@firetop.home> (Richard Sandiford's message of "Thu, 24 Feb 2005 21:05:18 +0000") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-02/txt/msg00639.txt.bz2 Richard Sandiford writes: > "Maciej W. Rozycki" writes: >> * config/tc-mips.c (macro): Avoid a reloc overflow for word >> memory transfers in expansions of the "li.d", "l.d", "s.d", "ld" >> and "sd" macros. > > Don't these instructions require doubleword-aligned addresses? > If so, I don't see the problem. The relocs for "sym+offset" > should always be sorted as: > > HI16 sym (in-place addend of %hi(offset)) > LO16 sym (in-place addend of %lo(offset)) > LO16 sym (in-place addend of %lo(offset+4)) > > and the linker will do the right thing. > > I suppose bad things could happen if you composed an aligned > address from an unaligned symbol and an unaligned offset, > but is that allowed? FWIW, I checked what the MIPSpro assembler does. Given: ld $4,foo as -32 -non_shared will generate: 0: 3c010000 lui at,0x0 0: R_MIPS_HI16 foo 4: 8c240000 lw a0,0(at) 4: R_MIPS_LO16 foo 8: 8c250004 lw a1,4(at) 8: R_MIPS_LO16 foo just like gas does. Not that I'm saying we should do something simply because MIPSpro does it. Just thought I'd throw it into the pot. [ Although, as is probably clear from earlier messages, my preference is to keep things the way they are, and require any symbolic component to be 8-byte aligned. I've never heard of any practical problems with that restriction. OTOH, after the above, I don't have any new data or arguments to add, so I'll shut up now ;) ] Richard