This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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 1/4]: Rewrite of the alpha-vms bfd back-end (gas)


This is a minor change to gas/config/tc-alpha.c to adjust with the new code.

Tristan.

gas/
2010-04-09  Tristan Gingold  <gingold@adacore.com>

	* config/tc-alpha.c: Includes vms/egps.h on EVAX.
	(s_alpha_comm): Used new EGPS macros from egps.h
	(RGPS__V_NO_SHIFT, EGPS__V_MASK): New local macros.
	(s_alpha_section_word): Add comments.  Use new EGPS macros.
	Adjust for modified bfd_vms_set_section_flags function.
---
 gas/config/tc-alpha.c |   42 +++++++++++++++++++++++++++---------------
 1 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 45144af..620f974 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -62,6 +62,7 @@
 
 #ifdef OBJ_EVAX
 #include "vms.h"
+#include "vms/egps.h"
 #endif
 
 #include "dwarf2dbg.h"
@@ -3561,8 +3562,8 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSED)
       sec = subseg_new (sec_name, 0);
       S_SET_SEGMENT (sec_symbol, sec);
       symbol_get_bfdsym (sec_symbol)->flags |= BSF_SECTION_SYM;
-      bfd_vms_set_section_flags (stdoutput, sec,
-				 EGPS_S_V_OVR | EGPS_S_V_GBL | EGPS_S_V_NOMOD);
+      bfd_vms_set_section_flags (stdoutput, sec, 0,
+				 EGPS__V_OVR | EGPS__V_GBL | EGPS__V_NOMOD);
       record_alignment (sec, log_align);
 
       /* Reuse stab_string_size to store the size of the section.  */
@@ -4210,6 +4211,14 @@ s_alpha_section_name (void)
   return name;
 }
 
+/* Put clear/set flags in one flagword.  The LSBs are flags to be set,
+   the MSBs are the flags to be cleared.  */
+
+#define EGPS__V_NO_SHIFT 16
+#define EGPS__V_MASK	 0xffff
+
+/* Parse one VMS section flag.  */
+
 static flagword
 s_alpha_section_word (char *str, size_t len)
 {
@@ -4226,30 +4235,30 @@ s_alpha_section_word (char *str, size_t len)
   if (len == 3)
     {
       if (strncmp (str, "PIC", 3) == 0)
-	flag = EGPS_S_V_PIC;
+	flag = EGPS__V_PIC;
       else if (strncmp (str, "LIB", 3) == 0)
-	flag = EGPS_S_V_LIB;
+	flag = EGPS__V_LIB;
       else if (strncmp (str, "OVR", 3) == 0)
-	flag = EGPS_S_V_OVR;
+	flag = EGPS__V_OVR;
       else if (strncmp (str, "REL", 3) == 0)
-	flag = EGPS_S_V_REL;
+	flag = EGPS__V_REL;
       else if (strncmp (str, "GBL", 3) == 0)
-	flag = EGPS_S_V_GBL;
+	flag = EGPS__V_GBL;
       else if (strncmp (str, "SHR", 3) == 0)
-	flag = EGPS_S_V_SHR;
+	flag = EGPS__V_SHR;
       else if (strncmp (str, "EXE", 3) == 0)
-	flag = EGPS_S_V_EXE;
+	flag = EGPS__V_EXE;
       else if (strncmp (str, "WRT", 3) == 0)
-	flag = EGPS_S_V_WRT;
+	flag = EGPS__V_WRT;
       else if (strncmp (str, "VEC", 3) == 0)
-	flag = EGPS_S_V_VEC;
+	flag = EGPS__V_VEC;
       else if (strncmp (str, "MOD", 3) == 0)
 	{
-	  flag = no ? EGPS_S_V_NOMOD : EGPS_S_V_NOMOD << EGPS_S_V_NO_SHIFT;
+	  flag = no ? EGPS__V_NOMOD : EGPS__V_NOMOD << EGPS__V_NO_SHIFT;
 	  no = 0;
 	}
       else if (strncmp (str, "COM", 3) == 0)
-	flag = EGPS_S_V_COM;
+	flag = EGPS__V_COM;
     }
 
   if (flag == 0)
@@ -4262,7 +4271,7 @@ s_alpha_section_word (char *str, size_t len)
     }
 
   if (no)
-    return flag << EGPS_S_V_NO_SHIFT;
+    return flag << EGPS__V_NO_SHIFT;
   else
     return flag;
 }
@@ -4315,7 +4324,10 @@ s_alpha_section (int secid)
 	symbol = symbol_find_or_make (name);
 	S_SET_SEGMENT (symbol, sec);
 	symbol_get_bfdsym (symbol)->flags |= BSF_SECTION_SYM;
-        bfd_vms_set_section_flags (stdoutput, sec, vms_flags);
+        bfd_vms_set_section_flags
+          (stdoutput, sec,
+           (vms_flags >> EGPS__V_NO_SHIFT) & EGPS__V_MASK,
+           vms_flags & EGPS__V_MASK);
     }
   else
     {
-- 
1.6.2


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