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]

Add new VMS sections


A documentation update to vms.texi, including this and other things, will
be forthcoming.

	* config/alpha/alpha.c (vms_attribute_table): Add new attributes.
	(alpha_write_linkage): Test for null alpha_links.
	(SECTION_VMS_GLOBAL, SECTION_VMS_INITIALIZE): New section attributes.
	(vms_section_type_flags, vms_asm_named_section): Handle them.

*** config/alpha/alpha.c	2001/12/09 21:54:23	1.212
--- config/alpha/alpha.c	2001/12/11 17:01:08
*************** alpha_using_fp ()
*** 5808,5815 ****
  const struct attribute_spec vms_attribute_table[] =
  {
    /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
!   { "overlaid", 0, 0, true,  false, false, NULL },
!   { NULL,       0, 0, false, false, false, NULL }
  };
  
  #endif
--- 5808,5817 ----
  const struct attribute_spec vms_attribute_table[] =
  {
    /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
!   { "overlaid",   0, 0, true,  false, false, NULL },
!   { "global",     0, 0, true,  false, false, NULL },
!   { "initialize", 0, 0, true,  false, false, NULL },
!   { NULL,         0, 0, false, false, false, NULL }
  };
  
  #endif
*************** void
*** 7959,7973 ****
  alpha_write_linkage (stream)
      FILE *stream;
  {
!   readonly_section ();
!   fprintf (stream, "\t.align 3\n");
!   splay_tree_foreach (alpha_links, alpha_write_one_linkage, stream);
  }
  
  /* Given a decl, a section name, and whether the decl initializer
     has relocs, choose attributes for the section.  */
  
  #define SECTION_VMS_OVERLAY	SECTION_FORGET
  
  static unsigned int
  vms_section_type_flags (decl, name, reloc)
--- 7961,7980 ----
  alpha_write_linkage (stream)
      FILE *stream;
  {
!   if (alpha_links)
!     {
!       readonly_section ();
!       fprintf (stream, "\t.align 3\n");
!       splay_tree_foreach (alpha_links, alpha_write_one_linkage, stream);
!     }
  }
  
  /* Given a decl, a section name, and whether the decl initializer
     has relocs, choose attributes for the section.  */
  
  #define SECTION_VMS_OVERLAY	SECTION_FORGET
+ #define SECTION_VMS_GLOBAL SECTION_MACH_DEP
+ #define SECTION_VMS_INITIALIZE (SECTION_VMS_GLOBAL << 1)
  
  static unsigned int
  vms_section_type_flags (decl, name, reloc)
*************** vms_section_type_flags (decl, name, relo
*** 7980,7985 ****
--- 7987,7998 ----
    if (decl && DECL_ATTRIBUTES (decl)
        && lookup_attribute ("overlaid", DECL_ATTRIBUTES (decl)))
      flags |= SECTION_VMS_OVERLAY;
+   if (decl && DECL_ATTRIBUTES (decl)
+       && lookup_attribute ("global", DECL_ATTRIBUTES (decl)))
+     flags |= SECTION_VMS_GLOBAL;
+   if (decl && DECL_ATTRIBUTES (decl)
+       && lookup_attribute ("initialize", DECL_ATTRIBUTES (decl)))
+     flags |= SECTION_VMS_INITIALIZE;
  
    return flags;
  }
*************** vms_asm_named_section (name, flags)
*** 7993,8006 ****
       const char *name;
       unsigned int flags;
  {
!   const char *flag_str = "";
  
    if (flags & SECTION_VMS_OVERLAY)
!     flag_str = ",OVR";
!   else if (flags & SECTION_DEBUG)
!     flag_str = ",NOWRT";
  
!   fprintf (asm_out_file, ".section\t%s%s\n", name, flag_str);
  }
  
  /* Record an element in the table of global constructors.  SYMBOL is
--- 8006,8024 ----
       const char *name;
       unsigned int flags;
  {
!   fputc ('\n', asm_out_file);
!   fprintf (asm_out_file, ".section\t%s", name);
  
    if (flags & SECTION_VMS_OVERLAY)
!     fprintf (asm_out_file, ",OVR");
!   if (flags & SECTION_VMS_GLOBAL)
!     fprintf (asm_out_file, ",GBL");
!   if (flags & SECTION_VMS_INITIALIZE)
!     fprintf (asm_out_file, ",NOMOD");
!   if (flags & SECTION_DEBUG)
!     fprintf (asm_out_file, ",NOWRT");
  
!   fputc ('\n', asm_out_file);
  }
  
  /* Record an element in the table of global constructors.  SYMBOL is


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