Author: yug
Date: 2011-10-11 23:27:39 -0400 (Tue, 11 Oct 2011)
New Revision: 3758

Modified:
   trunk/osprey/common/com/erglob.desc
   trunk/osprey/common/com/erglob.h
   trunk/osprey/common/com/symtab_verify.cxx
   trunk/osprey/wgen/wgen_decl.cxx
Log:
fix bug 878 and bug 670. Since gnu allows aliased symbol to be different 
storage and type from the base, so change to be compatible with gnu. Output 
warning for these cases.

Code Review:
Lai Jian-xin and Sun Chan.


Modified: trunk/osprey/common/com/erglob.desc
===================================================================
--- trunk/osprey/common/com/erglob.desc 2011-10-10 15:18:26 UTC (rev 3757)
+++ trunk/osprey/common/com/erglob.desc 2011-10-12 03:27:39 UTC (rev 3758)
@@ -417,12 +417,15 @@
 #ifdef KEY
   { EC_Bad_Omp,                EM_User | ES_ERRABORT,          RAG_EN_NONE,
     "%s", 1, ET_STRING, 0, 0, 0, 0, 0 },
-  { EC_Ill_Alias,      EM_User | ES_ERRABORT,          RAG_EN_NONE,
+  { EC_Ill_Alias,      EM_User | ES_WARNING,           RAG_EN_NONE,
     "Declaration of alias \"%s\" does not match its target \"%s\".",
     2, ET_STRING, ET_STRING, 0, 0, 0, 0 },
   { EC_Misc_Asm,       EM_User | ES_ERRABORT,          RAG_EN_NONE,
     "%s", 1, ET_STRING, 0, 0, 0, 0, 0 },
 #endif /* KEY */
+  { EC_Sym_Sto_Cla,     EM_User | ES_WARNING , RAG_EN_NONE,
+    "Storage of alias \"%s\" should be identical as its target \"%s\".",
+    2, ET_STRING, ET_STRING, 0, 0, 0, 0 },
 
   { EC_Ill_Align,      EM_User | ES_WARNING ,  RAG_EN_NONE,
     "Illegal alignment (%d) in %s",

Modified: trunk/osprey/common/com/erglob.h
===================================================================
--- trunk/osprey/common/com/erglob.h    2011-10-10 15:18:26 UTC (rev 3757)
+++ trunk/osprey/common/com/erglob.h    2011-10-12 03:27:39 UTC (rev 3758)
@@ -350,7 +350,10 @@
 #define EC_Inv_Asm_Opnd EC_Undef_Code+340       /* none */
 #define EC_Misc_Asm EC_Undef_Code+341          /* str */
 #endif
+/* Symtab Alias Storage Verfication: */
+#define EC_Sym_Sto_Cla EC_Undef_Code+354        /* str,str */
 
+
 
 /* ====================================================================
  *
@@ -477,6 +480,7 @@
 /* IPA dladd error codes: */
 #define EC_IP_Load_Dso  EC_BASE_FILE+120    /* str, str */
 
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/osprey/common/com/symtab_verify.cxx
===================================================================
--- trunk/osprey/common/com/symtab_verify.cxx   2011-10-10 15:18:26 UTC (rev 
3757)
+++ trunk/osprey/common/com/symtab_verify.cxx   2011-10-12 03:27:39 UTC (rev 
3758)
@@ -59,6 +59,7 @@
 #endif
 
 #include "symtab_defs.h"
+#include "erglob.h"
 
 // ======================================================================
 // Auxiliary functions used by ST::Verify()
@@ -514,9 +515,13 @@
     if ( ST_storage_class (*sb) != SCLASS_UNKNOWN) {
 
       if ( !ST_is_weak_symbol (s) )
-        Is_True( ST_storage_class(s) == ST_storage_class(*sb),
-                 (msg,"storage class, should be identical as based blocks"));
-
+        {
+          /* open64.net bug878, aliased symbol storage class may not be equal 
+             to the base. */
+          if (ST_storage_class(s) != ST_storage_class(*sb)) {
+            ErrMsg(EC_Sym_Sto_Cla, ST_name(s), ST_name(sb));
+          }
+        }
     }
     else {
       // Property 1b For blocks such as bss, SCLASS== UNKNOWN and EXPORT==LOCAL

Modified: trunk/osprey/wgen/wgen_decl.cxx
===================================================================
--- trunk/osprey/wgen/wgen_decl.cxx     2011-10-10 15:18:26 UTC (rev 3757)
+++ trunk/osprey/wgen/wgen_decl.cxx     2011-10-12 03:27:39 UTC (rev 3758)
@@ -4723,7 +4723,6 @@
   else {
     Set_ST_base_idx (st, ST_st_idx (base_st));
     Set_ST_emit_symbol(st);    // for cg
-    Set_ST_sclass (st, ST_sclass (base_st));
     if (ST_is_initialized (base_st))
       Set_ST_is_initialized (st);
 #ifdef KEY
@@ -4734,9 +4733,12 @@
 #ifdef KEY
   if (!lang_cplus)
   {
-    // bug 4981: symbol class of ST must match that of the target
-    if (ST_sym_class (st) != ST_sym_class (base_st))
+    if (ST_sym_class (st) != ST_sym_class (base_st)) {
+      /* open64.net bug 878, change the aliased sym class and type to the base 
st */
       ErrMsg (EC_Ill_Alias, ST_name (st), ST_name (base_st));
+      Set_ST_class(st, ST_class(base_st));
+      Set_ST_type(st,ST_type(base_st));
+    }
 
     // bugs 5145, 11993
     if (ST_sym_class (base_st) == CLASS_FUNC)


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to