Hi,

libiberty/pex-unix.c uses the global variable 'environ', which is available on 
VMS but with a DEC-C name.
This patch adds a translation for it in the VMS table.

Committed on trunk.

Tristan.

2011-12-16  Tristan Gingold  <ging...@adacore.com>

        * config/vms/vms.c (VMS_CRTL_GLOBAL): Define.
        (vms_patch_builtins): Handle.
        * config/vms/vms-crtlmap.map: Add an entry for environ.

Index: vms-crtlmap.map
===================================================================
--- vms-crtlmap.map     (revision 182402)
+++ vms-crtlmap.map     (working copy)
@@ -63,6 +63,7 @@
 ctime
 dup
 dup2
+environ       GLOBAL
 exit
 exp           FLOAT
 fabs          FLOAT
Index: vms.c
===================================================================
--- vms.c       (revision 182402)
+++ vms.c       (working copy)
@@ -45,6 +45,9 @@
 /* Prepend x before the name for printf like functions.  */
 #define VMS_CRTL_PRNTF (1 << 4)
 
+/* Prepend ga_ for global data.  */
+#define VMS_CRTL_GLOBAL (1 << 5)
+
 struct vms_crtl_name
 {
   /* The standard C name.  */
@@ -123,6 +126,12 @@
           rlen += 9;
         }
 
+      if (n->flags & VMS_CRTL_GLOBAL)
+        {
+          memcpy (res + rlen, "ga_", 3);
+          rlen += 3;
+        }
+
       if (n->flags & VMS_CRTL_FLOAT)
         res[rlen++] = 't';
 

Reply via email to