This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH/RFA] sh-elf: Unnecessary relocations
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 27 Sep 2002 07:07:38 -0400 (EDT)
- Subject: Re: [PATCH/RFA] sh-elf: Unnecessary relocations
On Fri, 27 Sep 2002, kaz Kojima wrote:
> 2002-09-27 Kaz Kojima <kkojima@rr.iij4u.or.jp>
>
> * config/tc-sh.c (sh_force_relocation): Return 0 for
> some PC relative relocations when not relaxing.
> * testsuite/gas/sh/pcrel2.s: New.
> * testsuite/gas/sh/pcrel2.d: New.
> * testsuite/gas/sh/basic.exp: Add pcrel2 test.
> --- ORIG/src/gas/testsuite/gas/sh/pcrel2.d Thu Jan 1 09:00:00 1970
> +++ TMP/src/gas/testsuite/gas/sh/pcrel2.d Fri Sep 27 12:20:31 2002
> @@ -0,0 +1,5 @@
> +#as: -big
> +#objdump: -r
> +#name: PC-relative loads
> +
> +.*: file format .*sh.*
> diff -urN ORIG/src/gas/testsuite/gas/sh/pcrel2.s TMP/src/gas/testsuite/gas/sh/pcrel2.s
Something is missing in the pcrel2.d file, it seems. Other than
that, it seems ok.
> --- ORIG/src/gas/testsuite/gas/sh/pcrel2.s Thu Jan 1 09:00:00 1970
> +++ TMP/src/gas/testsuite/gas/sh/pcrel2.s Fri Sep 27 12:19:15 2002
> + .globl foo
> +foo:
> + .long . - foo
A thought here. Isn't this commonly generated by gcc in the
absence of -fpic/-fPIC? If so, then I guess -fpic/-fPIC is
required for DSO:s and there's no support for DT_TEXTREL.
Is that the case? (I don't mind, though; -fpic/-fPIC is
required for CRIS but elf32-cris.c emits an error message in
elf_backend_check_relocs when bad relocs are found when
-shared.)
brgds, H-P