*** empty log message ***
[deliverable/binutils-gdb.git] / gas / write.c
index 06133679b54df38a4e0a3edd08e6252c9e8cc1ca..5c336d8bb97b59b44bc474bf984d71d55430b161 100644 (file)
@@ -1493,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
@@ -1519,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.023444 seconds and 4 git commands to generate.