This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Allow aliases where target is a number for VMS


Support for VMS pragma import_exception which uses an alias to define an absolute symbol.

OK to commit?

--Douglas Rupp for Tristan Gingold
AdaCore
2009-07-24  Tristan Gingold  <tristan@adacore.com>
            Douglas B Rupp  <rupp@gnat.com>

	* varasm.c (finish_aliases_1): Allow aliases whose target is a number.

diff -rupN gcc/varasm.c gcc/varasm.c
--- gcc/varasm.c	2008-11-30 08:35:59.000000000 -0800
+++ gcc/varasm.c	2009-01-21 14:43:37.000000000 -0800
@@ -5545,7 +5545,14 @@ finish_aliases_1 (void)
       target_decl = find_decl_and_mark_needed (p->decl, p->target);
       if (target_decl == NULL)
 	{
-	  if (! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
+	  const char *id = IDENTIFIER_POINTER (p->target);
+	  if (*id >= '0' && *id <= '9')
+	    {
+	      /* Extension: an alias whose target is an address creates an
+		 absolute symbol.  */
+	      ;
+	    }
+	  else if (! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
 	    error ("%q+D aliased to undefined symbol %qE",
 		   p->decl, p->target);
 	}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]