This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch]: vms: map 'environ'
- From: Tristan Gingold <gingold at adacore dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 Dec 2011 16:24:16 +0100
- Subject: [Patch]: vms: map 'environ'
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 <gingold@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';