*** empty log message ***
[deliverable/binutils-gdb.git] / gas / write.c
index 5546b6849eca0412c7f7ad71535868f53c25d096..5c336d8bb97b59b44bc474bf984d71d55430b161 100644 (file)
@@ -681,17 +681,8 @@ adjust_reloc_syms (bfd *abfd ATTRIBUTE_UNUSED,
        if (symbol_equated_reloc_p (sym)
            || S_IS_WEAKREFR (sym))
          {
-           symbolS *new_sym
-             = symbol_get_value_expression (sym)->X_add_symbol;
-           const char *name = S_GET_NAME (sym);
-           if (!S_IS_COMMON (new_sym)
-               && !TC_FAKE_LABEL (name)
-               && !S_IS_WEAKREFR (sym)
-               && (!S_IS_EXTERNAL (sym) || S_IS_LOCAL (sym)))
-             as_bad (_("Local symbol `%s' can't be equated to undefined symbol `%s'"),
-                     name, S_GET_NAME (new_sym));
            fixp->fx_offset += symbol_get_value_expression (sym)->X_add_number;
-           sym = new_sym;
+           sym = symbol_get_value_expression (sym)->X_add_symbol;
            fixp->fx_addsy = sym;
          }
 
@@ -1502,12 +1493,6 @@ write_object_file (void)
              continue;
            }
 
-         /* So far, common symbols have been treated like undefined symbols.
-            Put them in the common section now.  */
-         if (S_IS_DEFINED (symp) == 0
-             && S_GET_VALUE (symp) != 0)
-           S_SET_SEGMENT (symp, bfd_com_section_ptr);
-
 #ifdef obj_frob_symbol
          obj_frob_symbol (symp, punt);
 #endif
@@ -1528,7 +1513,8 @@ write_object_file (void)
                 opposites.  Sometimes the former checks flags and the
                 latter examines the name...  */
              || (!S_IS_EXTERNAL (symp)
-                 && (punt || S_IS_LOCAL (symp) || S_IS_WEAKREFD (symp))
+                 && (punt || S_IS_LOCAL (symp) ||
+                     (S_IS_WEAKREFD (symp) && ! symbol_used_p (symp)))
                  && ! symbol_used_in_reloc_p (symp)))
            {
              symbol_remove (symp, &symbol_rootP, &symbol_lastP);
This page took 0.024392 seconds and 4 git commands to generate.