AS reloc bug

Alan Modra amodra@bigpond.net.au
Sat Aug 16 03:21:00 GMT 2003


On Fri, Aug 15, 2003 at 08:46:54PM +0200, Mikulas Patocka wrote:
> I send a patch that solves this problem. I am not sure if patch is
> correct, it needs some to be checked by someone who understands it.
> 
> --- gas/write.c_	Fri Aug 15 20:29:31 2003
> +++ gas/write.c	Fri Aug 15 20:29:36 2003
> @@ -2645,16 +2645,8 @@
>  	      fixP->fx_offset = add_number;
>  	      /* If the back-end code has selected a pc-relative
>  		 reloc, adjust the value to be pc-relative.  */
> -	      if (1
> -#ifdef TC_M68K
> -		  /* See the comment below about 68k weirdness.  */
> -		  && 0
> -#endif
> -		  && fixP->fx_pcrel)
> -		add_number -= MD_PCREL_FROM_SECTION (fixP, this_segment); 
>  	      fixP->fx_addsy = NULL;
>  	      fixP->fx_subsy = NULL;
> -	      fixP->fx_pcrel = 0;
>  	    }
>  	  else if (sub_symbol_segment == absolute_section
>  		   && !TC_FORCE_RELOCATION_SUB_ABS (fixP))

I'd like to rip that piece of code out too.  Trouble is, last time I
tried, it broke some gas targets.  Hmm, perhaps it's worth trying a
testsuite run again with just this change as I probably was trying other
cleanups as well.

When making changes to the generic gas reloc code, you need to run the
binutils testsuite against a good number of targets.  I suggest at least
the following:  a29k-coff alpha-linuxecoff alpha-linux arc-elf arm-aout
arm-coff arm-linux avr-elf cris-elf d10v-elf d30v-elf dlx-elf fr30-elf
frv-elf hppa-linux hppa64-linux h8300-rtems h8300-elf h8500-rtems
i370-linux i586-coff i586-aout i586-linux i686-pe i860-stardent-elf
i960-intel-nindy i960-coff i960-elf ia64-linux ip2k-elf m32r-elf
m68hc11-elf m68hc12-elf m68k-aout m68k-netbsd m68k-coff m68k-linux
m88k-coff mcore-elf mcore-pe mips-ecoff mips-linux mmix-elf mn10200-elf
mn10300-elf openrisc-elf or32-coff or32-elf pj-elf powerpc-linux
powerpc64-linux rs6000-aix4.3.3 rs6000-aix5.1 s390x-linux s390-linux
sh-linux sh-pe sh-rtems sh64-elf ns32k-netbsd sparc-aout sparc-coff
sparc-linux sparc64-linux tic30-unknown-aout tic30-unknown-coff
tic4x-coff tic54x-coff tic80-coff v850-elf vax-netbsdelf vax-netbsd
vax-vms w65-unknown-coff x86_64-linux xstormy16-elf z8k-coff

Since some of these targets have known bugs, you need to do runs both
before and after your changes to check that no new regressions are
introduced.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list