]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2013-03-08 Chung-Lin Tang <cltang@codesourcery.com>
authorChung-Lin Tang <cltang@codesourcery.com>
Fri, 8 Mar 2013 10:17:00 +0000 (10:17 +0000)
committerChung-Lin Tang <cltang@codesourcery.com>
Fri, 8 Mar 2013 10:17:00 +0000 (10:17 +0000)
* write.h (struct fix): Add fx_dot_frag field.
(dot_frag): Declare.
* write.c (dot_frag): New variable.
(fix_new_internal): Set fx_dot_frag field with dot_frag.
(fixup_segment): Base calculation of fx_offset with fx_dot_frag.
* expr.c (expr): Save value of frag_now in dot_frag when setting
dot_value.
* read.c (emit_expr): Likewise. Delete comments.

gas/ChangeLog
gas/expr.c
gas/read.c
gas/write.c
gas/write.h

index 40276f40460b20cd3e1deb0dd3b36ed957f83aa5..ce3be4b53f89afb34f73b15c9796f2cdfb66c41c 100644 (file)
@@ -1,3 +1,14 @@
+2013-03-08  Chung-Lin Tang  <cltang@codesourcery.com>
+
+       * write.h (struct fix): Add fx_dot_frag field.
+       (dot_frag): Declare.
+       * write.c (dot_frag): New variable.
+       (fix_new_internal): Set fx_dot_frag field with dot_frag.
+       (fixup_segment): Base calculation of fx_offset with fx_dot_frag.
+       * expr.c (expr): Save value of frag_now in dot_frag when setting
+       dot_value.
+       * read.c (emit_expr): Likewise. Delete comments.
+
 2013-03-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/tc-i386.c (flag_code_names): Removed.
index 105153ede326cf3b3ba059c31c118779d6545773..500f93840ba59d86fb622e1916106bbf9fa5790d 100644 (file)
@@ -1735,7 +1735,10 @@ expr (int rankarg,               /* Larger # is higher rank.  */
 
   /* Save the value of dot for the fixup code.  */
   if (rank == 0)
-    dot_value = frag_now_fix ();
+    {
+      dot_value = frag_now_fix ();
+      dot_frag = frag_now;
+    }
 
   retval = operand (resultP, mode);
 
index d65971cfbec53185df42ed04759f6fe5e65500f3..2df748a9ad06d259d55c1f559afd891ab77455be 100644 (file)
@@ -4087,10 +4087,9 @@ emit_expr (expressionS *exp, unsigned int nbytes)
   if (need_pass_2)
     return;
 
-  /* Grow the current frag now so that dot_value does not get invalidated
-     if the frag were to fill up in the frag_more() call below.  */
   frag_grow (nbytes);
   dot_value = frag_now_fix ();
+  dot_frag = frag_now;
 
 #ifndef NO_LISTING
 #ifdef OBJ_ELF
index 1d27db782ea118aaf4357f799ba9cf4122764ab7..22e68c5ec8fe0474d9b2df97701298b5f06c5ee4 100644 (file)
@@ -122,6 +122,9 @@ symbolS *abs_section_sym;
 /* Remember the value of dot when parsing expressions.  */
 addressT dot_value;
 
+/* The frag that dot_value is based from.  */
+fragS *dot_frag;
+
 /* Relocs generated by ".reloc" pseudo.  */
 struct reloc_list* reloc_list;
 
@@ -169,6 +172,7 @@ fix_new_internal (fragS *frag,              /* Which frag?  */
   fixP->fx_subsy = sub_symbol;
   fixP->fx_offset = offset;
   fixP->fx_dot_value = dot_value;
+  fixP->fx_dot_frag = dot_frag;
   fixP->fx_pcrel = pcrel;
   fixP->fx_r_type = r_type;
   fixP->fx_im_disp = 0;
@@ -977,7 +981,7 @@ fixup_segment (fixS *fixP, segT this_segment)
            {
              add_number -= S_GET_VALUE (fixP->fx_subsy);
              fixP->fx_offset = (add_number + fixP->fx_dot_value
-                                + fixP->fx_frag->fr_address);
+                                + fixP->fx_dot_frag->fr_address);
 
              /* Make it pc-relative.  If the back-end code has not
                 selected a pc-relative reloc, cancel the adjustment
index d7215816da92767089117d62c7767dc75096464b..36de533b325cb5c9c49bc719049ead850392a49d 100644 (file)
@@ -88,6 +88,9 @@ struct fix
   /* The value of dot when the fixup expression was parsed.  */
   addressT fx_dot_value;
 
+  /* The frag fx_dot_value is based on.  */
+  fragS *fx_dot_frag;
+
   /* Next fixS in linked list, or NULL.  */
   struct fix *fx_next;
 
@@ -162,6 +165,7 @@ struct reloc_list
 extern int finalize_syms;
 extern symbolS *abs_section_sym;
 extern addressT dot_value;
+extern fragS *dot_frag;
 extern struct reloc_list* reloc_list;
 
 extern void append (char **charPP, char *fromP, unsigned long length);