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


Hans-Peter Nilsson <hp@bitrange.com> wrote:
>> +#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.

I thought it checks that there is no relocations made. How can
I write such script?

>> +	.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.)

SH gcc generates such expressions for the switch statement in
non-pic case. I'm not sure about another cases without -fpic,
though.
Thanks,
	kaz


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