Allow global declaration after symbol definition
authorCharles Crayne <chuck@thor.crayne.org>
Thu, 29 Jan 2009 03:07:18 +0000 (19:07 -0800)
committerCharles Crayne <chuck@thor.crayne.org>
Thu, 29 Jan 2009 03:07:18 +0000 (19:07 -0800)
This experimental feature needs to be tested for
all output formats which recognize global symbols.

labels.c

index df32315..9a7fc61 100644 (file)
--- a/labels.c
+++ b/labels.c
@@ -362,9 +362,11 @@ void declare_as_global(char *label, char *special, efunc error)
     case GLOBAL_SYMBOL:
         break;
     case LOCAL_SYMBOL:
-        if (!(lptr->defn.is_global & EXTERN_BIT))
-            error(ERR_NONFATAL, "symbol `%s': GLOBAL directive must"
-                  " appear before symbol definition", label);
+        if (!(lptr->defn.is_global & EXTERN_BIT)) {
+            error(ERR_WARNING, "symbol `%s': GLOBAL directive "
+                  "after symbol definition is an experimental feature", label);
+            lptr->defn.is_global = GLOBAL_SYMBOL;
+        }
         break;
     }
 }