Suspected bug in the current m68k gas relaxer

Michael Sokolov msokolov@ivan.Harhan.ORG
Wed Apr 19 13:38:00 GMT 2000


I wrote:

> The patch is below.

but forgot to append it! Here it is:

2000-04-19  Michael Sokolov  <msokolov@ivan.Harhan.ORG>

	* tc-m68k.c (m68k-ip: case ABSL): relax absolute references to 16-bit
	PC-relative on all CPUs. (md_estimate_size_before_relax): likewise.

Index: tc-m68k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.c,v
retrieving revision 1.5
diff -c -3 -p -r1.5 tc-m68k.c
*** tc-m68k.c	1999/07/12 08:34:56	1.5
--- tc-m68k.c	2000/04/19 20:16:50
*************** m68k_ip (instring)
*** 2363,2370 ****
  		      addword (nextword);
  		      break;
  		    }
- 		  /* Don't generate pc relative code on 68010 and
- 		     68000.  */
  		  if (isvar (&opP->disp)
  		      && !subs (&opP->disp)
  		      && adds (&opP->disp)
--- 2368,2373 ----
*************** m68k_ip (instring)
*** 2375,2381 ****
  #endif
  		      && S_GET_SEGMENT (adds (&opP->disp)) == now_seg
  		      && relaxable_symbol (adds (&opP->disp))
- 		      && HAVE_LONG_BRANCH(current_architecture)
  		      && !flag_long_jumps
  		      && !strchr ("~%&$?", s[0]))
  		    {
--- 2378,2383 ----
*************** md_estimate_size_before_relax (fragP, se
*** 4593,4601 ****
        {
  	if ((S_GET_SEGMENT (fragP->fr_symbol) == segment
  	     && relaxable_symbol (fragP->fr_symbol))
! 	    || flag_short_refs
! 	    || cpu_of_arch (current_architecture) < m68020
! 	    || cpu_of_arch (current_architecture) == mcf5200)
  	  {
  	    fragP->fr_subtype = TAB (PCREL, SHORT);
  	    fragP->fr_var += 2;
--- 4609,4615 ----
        {
  	if ((S_GET_SEGMENT (fragP->fr_symbol) == segment
  	     && relaxable_symbol (fragP->fr_symbol))
! 	    || flag_short_refs)
  	  {
  	    fragP->fr_subtype = TAB (PCREL, SHORT);
  	    fragP->fr_var += 2;


More information about the Binutils mailing list