From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6365 invoked by alias); 23 Mar 2004 15:28:05 -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 6346 invoked from network); 23 Mar 2004 15:28:04 -0000 Received: from unknown (HELO r-rr.iij4u.or.jp) (210.130.0.76) by sources.redhat.com with SMTP; 23 Mar 2004 15:28:04 -0000 Received: from localhost (frgw.3in.ne.jp [210.251.121.226]) by r-rr.iij4u.or.jp (8.11.6+IIJ/8.11.6) with ESMTP id i2NFS1l00974 for ; Wed, 24 Mar 2004 00:28:01 +0900 (JST) Date: Tue, 23 Mar 2004 18:24:00 -0000 Message-Id: <20040324.002605.26970997.kkojima@rr.iij4u.or.jp> To: binutils@sources.redhat.com Subject: Re: [PATCH-SH]:Generating proper relocations to link with Renesas SHC linker From: Kaz Kojima In-Reply-To: <69595093233BB547BB70CF5E492B63F201D0410A@sohm.kpit.com> References: <69595093233BB547BB70CF5E492B63F201D0410A@sohm.kpit.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-03/txt/msg00524.txt.bz2 "Asgari J. Jinia" wrote: > If GNU object file for SH target which contains static functions is linked > with other Renesas SHC objects by SHC linker, it does not call GNU > functions properly. It always calls the first static function when other > static functions are called. This is because GNU assembler does not emit > relocations with addend values in case of static functions. > > Following patch emits addend value in relocations for static declarations so > that it will correctly link with Renesas linker. [snip] > --- gas/config/tc-sh.c.old Wed Dec 31 17:05:28 2003 > +++ gas/config/tc-sh.c Tue Mar 23 17:26:03 2004 > @@ -3957,7 +3957,7 @@ tc_gen_reloc (section, fixp) > else if (fixp->fx_pcrel) > rel->addend = fixp->fx_addnumber; > else if (r_type == BFD_RELOC_32 || r_type == BFD_RELOC_32_GOTOFF) > - rel->addend = fixp->fx_addnumber; > + rel->addend = fixp->fx_offset; > else > rel->addend = 0; With your patch, I've got many failures of ld testsuite for sh-unknown-linux-gnu and one failure about partial linking for sh-elf on mainline. It seems that gas with your patch sets both in-place relocation and addend for R_SH_DIR32. It would be a radical change of ABI and anyway, your patch doesn't work together with the current GNU linker. Regards, kaz