This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] [ARC] Add linker relaxation.
- From: Nick Clifton <nickc at redhat dot com>
- To: Claudiu Zissulescu <claziss at gmail dot com>, binutils at sourceware dot org
- Cc: fbedard at synopsys dot com, claziss at synopsys dot com
- Date: Wed, 24 Jul 2019 15:07:15 +0100
- Subject: Re: [PATCH] [ARC] Add linker relaxation.
- References: <20190724133403.4918-1-claziss@gmail.com>
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 ?
> 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).
> +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 ?
Also - formatting. Please do not end lines with opening curly braces.
But apart from that the patch looks good to me.
Cheers
Nick