Fix typo
[deliverable/binutils-gdb.git] / gas / symbols.c
index 9eaef1680470d5bdb33e9785c13ab8a5b09a5b2e..ebcad5bf21b564a4d837879f555c45813fa3a392 100644 (file)
@@ -17,8 +17,8 @@
 
    You should have received a copy of the GNU General Public License
    along with GAS; see the file COPYING.  If not, write to the Free
-   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 /* #define DEBUG_SYMS / * to debug symbol list maintenance.  */
 
@@ -197,7 +197,7 @@ static unsigned long local_symbol_conversion_count;
 
 /* Create a local symbol and insert it into the local hash table.  */
 
-struct local_symbol *
+static struct local_symbol *
 local_symbol_make (const char *name, segT section, valueT value, fragS *frag)
 {
   char *name_copy;
@@ -794,19 +794,6 @@ verify_symbol_chain (symbolS *rootP, symbolS *lastP)
   assert (lastP == symbolP);
 }
 
-void
-verify_symbol_chain_2 (symbolS *sym)
-{
-  symbolS *p = sym, *n = sym;
-#ifdef SYMBOLS_NEED_BACKPOINTERS
-  while (symbol_previous (p))
-    p = symbol_previous (p);
-#endif
-  while (symbol_next (n))
-    n = symbol_next (n);
-  verify_symbol_chain (p, n);
-}
-
 static void
 report_op_error (symbolS *symp, symbolS *left, symbolS *right)
 {
@@ -919,6 +906,7 @@ resolve_symbol_value (symbolS *symp)
       offsetT left, right;
       segT seg_left, seg_right;
       operatorT op;
+      int move_seg_ok;
 
       symp->sy_resolving = 1;
 
@@ -1104,18 +1092,15 @@ resolve_symbol_value (symbolS *symp)
                }
            }
 
+         move_seg_ok = 1;
          /* Equality and non-equality tests are permitted on anything.
             Subtraction, and other comparison operators are permitted if
             both operands are in the same section.  Otherwise, both
             operands must be absolute.  We already handled the case of
             addition or subtraction of a constant above.  This will
             probably need to be changed for an object file format which
-            supports arbitrary expressions, such as IEEE-695.
-
-            Don't emit messages unless we're finalizing the symbol value,
-            otherwise we may get the same message multiple times.  */
-         if (finalize_syms
-             && !(seg_left == absolute_section
+            supports arbitrary expressions, such as IEEE-695.  */
+         if (!(seg_left == absolute_section
                   && seg_right == absolute_section)
              && !(op == O_eq || op == O_ne)
              && !((op == O_subtract
@@ -1123,9 +1108,21 @@ resolve_symbol_value (symbolS *symp)
                   && seg_left == seg_right
                   && (seg_left != undefined_section
                       || add_symbol == op_symbol)))
-           report_op_error (symp, add_symbol, op_symbol);
+           {
+             /* Don't emit messages unless we're finalizing the symbol value,
+                otherwise we may get the same message multiple times.  */
+             if (finalize_syms)
+               report_op_error (symp, add_symbol, op_symbol);
+             /* However do not move the symbol into the absolute section
+                if it cannot currently be resolved - this would confuse
+                other parts of the assembler into believing that the
+                expression had been evaluated to zero.  */
+             else
+               move_seg_ok = 0;
+           }
 
-         if (final_seg == expr_section || final_seg == undefined_section)
+         if (move_seg_ok
+             && (final_seg == expr_section || final_seg == undefined_section))
            final_seg = absolute_section;
 
          /* Check for division by zero.  */
@@ -2361,7 +2358,7 @@ int indent_level;
 
 /* Maximum indent level.
    Available for modification inside a gdb session.  */
-int max_indent_level = 8;
+static int max_indent_level = 8;
 
 void
 print_symbol_value_1 (FILE *file, symbolS *sym)
This page took 0.02523 seconds and 4 git commands to generate.