This is the mail archive of the binutils@sourceware.org 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] internal error for backwards .org


On Mon, Jun 23, 2008 at 02:31:35PM -0700, Bob Wilson wrote:
> 2008-06-23  Bob Wilson  <bob.wilson@acm.org>
> 	
> 	* write.c (relax_segment): Move check for backwards .org after
> 	subtracting the current stretch value from the growth.

Hi Bob, your patch is fine but I'm going to commit the following
variation, as I think it makes the code clearer.

2008-06-24  Bob Wilson  <bob.wilson@acm.org>
	    Alan Modra  <amodra@bigpond.net.au>
	
	* write.c (relax_segment <rs_org>): Include current stretch
	value when calculating whether .org is backwards.

Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.115
diff -u -p -r1.115 write.c
--- gas/write.c	3 Mar 2008 15:28:58 -0000	1.115
+++ gas/write.c	24 Jun 2008 01:36:53 -0000
@@ -2305,7 +2305,7 @@ relax_segment (struct frag *segment_frag
 		    }
 
 		  know (fragP->fr_next);
-		  after = fragP->fr_next->fr_address;
+		  after = fragP->fr_next->fr_address + stretch;
 		  growth = target - after;
 		  if (growth < 0)
 		    {
@@ -2340,14 +2340,10 @@ relax_segment (struct frag *segment_frag
 		      fragP->fr_type = rs_align;
 		      fragP->fr_subtype = 0;
 		      fragP->fr_offset = 0;
-		      fragP->fr_fix = after - was_address;
-		      break;
+		      fragP->fr_fix = after - address;
 		    }
-
-		  /* This is an absolute growth factor  */
-		  growth -= stretch;
-		  break;
 		}
+		break;
 
 	      case rs_space:
 		growth = 0;

-- 
Alan Modra
Australia Development Lab, IBM


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