Remove trailing spaces in gas
[deliverable/binutils-gdb.git] / gas / config / tc-alpha.c
index e9dd0fef400e5874ed5b0e57a0cd3391420e4291..a19fbc5a931a8a7f8bb066b92ba93cf669505aae 100644 (file)
@@ -1,7 +1,5 @@
 /* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU.
-   Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
-   Free Software Foundation, Inc.
+   Copyright (C) 1989-2015 Free Software Foundation, Inc.
    Contributed by Carnegie Mellon University, 1993.
    Written by Alessandro Forin, based on earlier gas-1.38 target CPU files.
    Modified by Ken Raeburn for gas-2.x and ECOFF support.
@@ -267,7 +265,7 @@ struct option md_longopts[] =
 #define OPTION_REPLACE (OPTION_RELAX + 1)
 #define OPTION_NOREPLACE (OPTION_REPLACE+1)
     { "replace", no_argument, NULL, OPTION_REPLACE },
-    { "noreplace", no_argument, NULL, OPTION_NOREPLACE },    
+    { "noreplace", no_argument, NULL, OPTION_NOREPLACE },
 #endif
     { NULL, no_argument, NULL, 0 }
   };
@@ -1394,7 +1392,7 @@ load_expression (int targreg,
                    gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
                    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_NOP;
                    ensym = symbol_find_or_make (ensymname);
-                   ensym->sy_used = 1;
+                   symbol_mark_used (ensym);
                    /* The fixup must be the same as the BFD_RELOC_ALPHA_BOH
                       case in emit_jsrjmp.  See B.4.5.2 of the OpenVMS Linker
                       Utility Manual.  */
@@ -1426,7 +1424,7 @@ load_expression (int targreg,
                    gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
                    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_LDA;
                    psym = symbol_find_or_make (psymname);
-                   psym->sy_used = 1;
+                   symbol_mark_used (psym);
                    insn.fixups[insn.nfixups].exp.X_op = O_subtract;
                    insn.fixups[insn.nfixups].exp.X_add_symbol = psym;
                    insn.fixups[insn.nfixups].exp.X_op_symbol = alpha_evax_proc->symbol;
@@ -1800,7 +1798,7 @@ emit_insn (struct alpha_insn *insn)
            default:
              gas_assert (size >= 1 && size <= 4);
            }
+
          pcrel = reloc_howto->pc_relative;
        }
 
@@ -1995,7 +1993,7 @@ insert_operand (unsigned insn,
        }
 
       if (val < min || val > max)
-       as_warn_value_out_of_range (_("operand"), val, min, max, file, line);
+       as_bad_value_out_of_range (_("operand"), val, min, max, file, line);
     }
 
   if (operand->insert)
@@ -2139,7 +2137,7 @@ assemble_insn (const struct alpha_opcode *opcode,
 
       /* If this is a real relocation (as opposed to a lituse hint), then
         the relocation width should match the operand width.
-        Take care of -MDISP in operand table.  */ 
+        Take care of -MDISP in operand table.  */
       else if (reloc < BFD_RELOC_UNUSED && reloc > 0)
        {
          reloc_howto_type *reloc_howto
@@ -2192,7 +2190,7 @@ emit_ir_load (const expressionS *tok,
   if (basereg == alpha_gp_register &&
       (symlen > 4 && strcmp (&symname [symlen - 4], "..lk") == 0))
     return;
-  
+
   newtok[0] = tok[0];
   set_tok_preg (newtok[2], basereg);
 
@@ -2233,7 +2231,7 @@ emit_loadstore (const expressionS *tok,
       if (alpha_noat_on)
        as_bad (_("macro requires $at register while noat in effect"));
 
-      lituse = load_expression (AXP_REG_AT, &tok[1], 
+      lituse = load_expression (AXP_REG_AT, &tok[1],
                                &basereg, &newtok[1], (const char *) opname);
     }
   else
@@ -3385,7 +3383,7 @@ add_to_link_pool (symbolS *sym, offsetT addend)
   fixS *fixp;
   symbolS *linksym, *expsym;
   expressionS e;
-  
+
   basesym = alpha_evax_proc->symbol;
 
   /* @@ This assumes all entries in a given section will be of the same
@@ -3558,7 +3556,7 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSED)
       segT current_seg = now_seg;
       subsegT current_subseg = now_subseg;
       int cur_size;
-      
+
       input_line_pointer++;
       SKIP_WHITESPACE ();
       sec_name = s_alpha_section_name ();
@@ -3602,7 +3600,7 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSED)
       frag_align (log_align, 0, 0);
       record_alignment (bss_section, log_align);
 
-      symbolP->sy_frag = frag_now;
+      symbol_set_frag (symbolP, frag_now);
       pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
                         size, NULL);
       *pfrag = 0;
@@ -3612,7 +3610,7 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSED)
       subseg_set (current_seg, current_subseg);
     }
 #endif
-  
+
   if (S_GET_VALUE (symbolP))
     {
       if (S_GET_VALUE (symbolP) != (valueT) size)
@@ -3628,7 +3626,7 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSED)
 #endif
       S_SET_EXTERNAL (symbolP);
     }
-  
+
 #ifndef OBJ_EVAX
   know (symbolP->sy_frag == &zero_address_frag);
 #endif
@@ -3693,6 +3691,8 @@ static struct alpha_elf_frame_data *all_frame_data;
 static struct alpha_elf_frame_data **plast_frame_data = &all_frame_data;
 static struct alpha_elf_frame_data *cur_frame_data;
 
+extern int all_cfi_sections;
+
 /* Handle the .section pseudo-op.  This is like the usual one, but it
    clears alpha_insn_label and restores auto alignment.  */
 
@@ -3716,6 +3716,8 @@ s_alpha_ent (int dummy ATTRIBUTE_UNUSED)
       char *name, name_end;
       name = input_line_pointer;
       name_end = get_symbol_end ();
+      /* CFI_EMIT_eh_frame is the default.  */
+      all_cfi_sections = CFI_EMIT_eh_frame;
 
       if (! is_name_beginner (*name))
        {
@@ -4063,6 +4065,7 @@ alpha_elf_md_end (void)
                                      S_GET_VALUE (p->func_sym),
                                      symbol_get_frag (p->func_sym)));
 
+       cfi_set_sections ();
        cfi_set_return_column (p->ra_regno);
        cfi_add_CFA_def_cfa_register (30);
        if (p->fp_regno != 30 || p->mask || p->fmask || p->frame_size)
@@ -4237,7 +4240,7 @@ s_alpha_section_word (char *str, size_t len)
     {
       no = 1;
       str += 2;
-      len -= 2; 
+      len -= 2;
     }
 
   if (len == 3)
@@ -4435,6 +4438,7 @@ static void
 s_alpha_frame (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
+  int ra;
 
   alpha_evax_proc->framereg = tc_get_register (1);
 
@@ -4450,7 +4454,10 @@ s_alpha_frame (int ignore ATTRIBUTE_UNUSED)
 
   alpha_evax_proc->framesize = val;
 
-  (void) tc_get_register (1);
+  ra = tc_get_register (1);
+  if (ra != AXP_REG_RA)
+    as_warn (_("Bad RA (%d) register for .frame"), ra);
+
   SKIP_WHITESPACE ();
   if (*input_line_pointer++ != ',')
     {
@@ -4467,13 +4474,12 @@ s_alpha_frame (int ignore ATTRIBUTE_UNUSED)
 static void
 s_alpha_prologue (int ignore ATTRIBUTE_UNUSED)
 {
-  get_absolute_expression ();
   demand_empty_rest_of_line ();
   alpha_prologue_label = symbol_new
     (FAKE_LABEL_NAME, now_seg, (valueT) frag_now_fix (), frag_now);
 }
 
-/* Parse .pdesc <entry_name>.
+/* Parse .pdesc <entry_name>,{null|stack|reg}
    Insert a procedure descriptor.  */
 
 static void
@@ -4481,7 +4487,7 @@ s_alpha_pdesc (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
-  register char *p;
+  char *p;
   expressionS exp;
   symbolS *entry_sym;
   const char *entry_sym_name;
@@ -4501,10 +4507,10 @@ s_alpha_pdesc (int ignore ATTRIBUTE_UNUSED)
       as_bad (_(".pdesc directive has no entry symbol"));
       return;
     }
-  
+
   entry_sym = make_expr_symbol (&exp);
   entry_sym_name = S_GET_NAME (entry_sym);
+
   /* Strip "..en".  */
   len = strlen (entry_sym_name);
   if (len < 4 || strcmp (entry_sym_name + len - 4, "..en") != 0)
@@ -4526,12 +4532,12 @@ s_alpha_pdesc (int ignore ATTRIBUTE_UNUSED)
 
   /* Define pdesc symbol.  */
   symbol_set_value_now (alpha_evax_proc->symbol);
+
   /* Save bfd symbol of proc entry in function symbol.  */
   ((struct evax_private_udata_struct *)
      symbol_get_bfdsym (alpha_evax_proc->symbol)->udata.p)->enbsym
        = symbol_get_bfdsym (entry_sym);
-  
+
   SKIP_WHITESPACE ();
   if (*input_line_pointer++ != ',')
     {
@@ -4697,35 +4703,30 @@ s_alpha_linkage (int ignore ATTRIBUTE_UNUSED)
   else
     {
       struct alpha_linkage_fixups *linkage_fixup;
-      
+
       p = frag_more (LKP_S_K_SIZE);
       memset (p, 0, LKP_S_K_SIZE);
       fixp = fix_new_exp
-       (frag_now, p - frag_now->fr_literal, LKP_S_K_SIZE, &exp, 0,\
+       (frag_now, p - frag_now->fr_literal, LKP_S_K_SIZE, &exp, 0,
         BFD_RELOC_ALPHA_LINKAGE);
 
+      if (alpha_insn_label == NULL)
+       alpha_insn_label = symbol_new
+         (FAKE_LABEL_NAME, now_seg, (valueT) frag_now_fix (), frag_now);
+
+      /* Create a linkage element.  */
       linkage_fixup = (struct alpha_linkage_fixups *)
        xmalloc (sizeof (struct alpha_linkage_fixups));
-
       linkage_fixup->fixp = fixp;
-      linkage_fixup->next = 0;
-
-      if (alpha_insn_label == 0)
-       alpha_insn_label = symbol_new
-         (FAKE_LABEL_NAME, now_seg, (valueT) frag_now_fix (), frag_now);
+      linkage_fixup->next = NULL;
       linkage_fixup->label = alpha_insn_label;
 
-      if (alpha_linkage_fixup_root == 0)
-       {
-         alpha_linkage_fixup_root = alpha_linkage_fixup_tail = linkage_fixup;
-         alpha_linkage_fixup_tail->next = 0;
-       }
+      /* Append it to the list.  */
+      if (alpha_linkage_fixup_root == NULL)
+        alpha_linkage_fixup_root = linkage_fixup;
       else
-       {
-         alpha_linkage_fixup_tail->next = linkage_fixup;
-         alpha_linkage_fixup_tail = linkage_fixup;
-         alpha_linkage_fixup_tail->next = 0;
-       }
+        alpha_linkage_fixup_tail->next = linkage_fixup;
+      alpha_linkage_fixup_tail = linkage_fixup;
     }
   demand_empty_rest_of_line ();
 }
@@ -5304,7 +5305,7 @@ maybe_set_gp (asection *sec)
 
   if (!sec)
     return;
-  vma = bfd_get_section_vma (foo, sec);
+  vma = bfd_get_section_vma (sec->owner, sec);
   if (vma && vma < alpha_gp_value)
     alpha_gp_value = vma;
 }
This page took 0.032742 seconds and 4 git commands to generate.