This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]