This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Fwd: Re: [PATCH] [ARC] Add linker relaxation.]
- From: Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Wed, 24 Jul 2019 14:30:09 +0000
- Subject: [Fwd: Re: [PATCH] [ARC] Add linker relaxation.]
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=synopsys.com;dmarc=pass action=none header.from=synopsys.com;dkim=pass header.d=synopsys.com;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=makWRFbz2stqFRqr3JG7fHwJU8b6vj2fjMnFto3NMjg=; b=DfzGqN3W8UvoiX3Hjo5d8s0gu8l94CiydcDqXNTKGsHz9nOOrkQoaGJ1qpsEgVDyDFzXLs2ETKPkamWKheWQ1Ylg/6SDhIbBQsg1zZkGWW4gXjJc41HPNniQE85a5s3lidbE5j4XSipThZvY+Z82yt26ZjODl2hxCeZUcPbapvD6L6e3Xqv3C00twwIu2s/Vy9pPqaPdjwUAV2UA8gKtLsAvrnM29ziHxNaBjL9mPRMuavAShJU6XGOIFZ/G/STfFCqPbRYMqASyNj3CE6cTVREAmk4/XiYu2UFzF42IwJDOxqv7Cl3aX3YdOCzBQ3MCgIYawtsMP5kpREOkkOcVOg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NtqgTfWJUyEnRVPPGxe9i7aSR0yPO2xGjN1Jg77vUtd/7iUpSnoWP8fYjTCGqXNvy8lww2fUT5uKvI+lCerjzCMLaCgDPYe2ne0C5M1ekkbNGE28r4HiihZW8/gxLQZvrKU38UNMiuHIxEozLpzA7kdipYZY7JItdpdfHf6shsxskrCiQTgwMyBGNUAzot+ZBPWQGLdhPDrI+BU2zxsrvoQ+AjskfQal2LEpJoX/kkCY41cP0hvo/GEwj3aP+PvvWu8aPyipshcoP2K5iDDe5t9KQwI4TfwBE4Y4uDzAYj9FrfkmwasPxxSA6Lj2oGOILVQV/E5j3n0Enz31rEz6IA==
- References: <634d9ad268001a7fb0c42a02d3cd2c333a6c60bc.camel@synopsys.com>
Forgot to forward to the group.
//Claudiu
-------- Forwarded Message --------
From: Claudiu Zissulescu <claziss@synopsys.com>
To: Nick Clifton <nickc@redhat.com>
Subject: Re: [PATCH] [ARC] Add linker relaxation.
Date: Wed, 24 Jul 2019 17:26:52 +0300
> Hi Nick,
>
> On Wed, 2019-07-24 at 15:07 +0100, Nick Clifton wrote:
> > Hi Claudiu,
> >
> > > Add linker relaxation. The first relaxation added is converting
> > > GOTPC32 to PCREL relocations. This relaxation doesn't change the size of
> > > the binary.
> >
> > As a matter of interest, what is the benefit of this relaxation ?
> > If it does not change the size then why bother ?
>
> Speed :) we replace a load instruction with an add.
>
> > > bfd/
> > > xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
> > >
> > > * elf32-arc.c (bfd_get_32_me): New function.
> > > (bfd_put_32_me): Likewise.
> > > (arc_elf_relax_section): Likewise.
> > > (bfd_elf32_bfd_relax_section): Define.
> > >
> > > ld/testsuite/
> > > xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
> > >
> > > * ld-arc/relax-local-pic.d: New test.
> > > * ld-arc/relax-local-pic.s: New file.
> >
> > Given that these changes are ARC specific, you can self-approve.
> > Or were you just posting here to let us know what you are doing ?
> > (If so, then it helps to include "COMMIT" in the subject line,
> > so that I know that the patch does not need a review).
>
> I've already pushed it :) Next time I will add COMMIT in the subject. Please
> apologize me for this.
>
> > > +static bfd_vma
> > > +bfd_get_32_me (bfd * abfd,const unsigned char * data)
> > > +{
> > > + bfd_vma value = 0;
> > > +
> > > + if (bfd_big_endian(abfd)) {
> > > + value = bfd_get_32 (abfd, data);
> > > + }
> > > + else {
> > > + value = ((bfd_get_8 (abfd, data) & 255) << 16);
> > > + value |= ((bfd_get_8 (abfd, data + 1) & 255) << 24);
> > > + value |= (bfd_get_8 (abfd, data + 2) & 255);
> > > + value |= ((bfd_get_8 (abfd, data + 3) & 255) << 8);
> > > + }
> >
> > Another curiosity - why "_me" ? Does it stand for middle-endian ?
>
> It is the "middle-endian" thing specific to ARC processors.
>
> > Also - formatting. Please do not end lines with opening curly braces.
>
> Aghh, it escaped me this, I will push an cleanup asap.
>
> > But apart from that the patch looks good to me.
> >
>
> Thanks!