* config/obj-evax.h (S_SET_OTHER, S_SET_TYPE, S_SET_DESC): Don't define.
[deliverable/binutils-gdb.git] / gas / config / obj-coff.c
index fdda18e371237e267ad09455add221363ba2fde9..792affa34d105a71ea7abca2aa00cd22aa91cd8e 100644 (file)
@@ -1,6 +1,6 @@
 /* coff object file format
    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
    Free Software Foundation, Inc.
 
    This file is part of GAS.
@@ -23,6 +23,7 @@
 #define OBJ_HEADER "obj-coff.h"
 
 #include "as.h"
+#include "safe-ctype.h"
 #include "obstack.h"
 #include "subsegs.h"
 
@@ -621,14 +622,11 @@ obj_coff_def (int what ATTRIBUTE_UNUSED)
   demand_empty_rest_of_line ();
 }
 
-unsigned int dim_index;
-
 static void
 obj_coff_endef (int ignore ATTRIBUTE_UNUSED)
 {
   symbolS *symbolP = NULL;
 
-  dim_index = 0;
   if (def_symbol_in_progress == NULL)
     {
       as_warn (_(".endef pseudo-op used outside of .def/.endef: ignored."));
@@ -861,7 +859,7 @@ obj_coff_endef (int ignore ATTRIBUTE_UNUSED)
 static void
 obj_coff_dim (int ignore ATTRIBUTE_UNUSED)
 {
-  int dim_index;
+  int d_index;
 
   if (def_symbol_in_progress == NULL)
     {
@@ -872,10 +870,10 @@ obj_coff_dim (int ignore ATTRIBUTE_UNUSED)
 
   S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1);
 
-  for (dim_index = 0; dim_index < DIMNUM; dim_index++)
+  for (d_index = 0; d_index < DIMNUM; d_index++)
     {
       SKIP_WHITESPACES ();
-      SA_SET_SYM_DIMEN (def_symbol_in_progress, dim_index,
+      SA_SET_SYM_DIMEN (def_symbol_in_progress, d_index,
                        get_absolute_expression ());
 
       switch (*input_line_pointer)
@@ -889,7 +887,7 @@ obj_coff_dim (int ignore ATTRIBUTE_UNUSED)
          /* Fall through.  */
        case '\n':
        case ';':
-         dim_index = DIMNUM;
+         d_index = DIMNUM;
          break;
        }
     }
@@ -1117,7 +1115,7 @@ weak_uniquify (const char * name)
   char *ret;
   const char * unique = "";
 
-#ifdef USE_UNIQUE
+#ifdef TE_PE
   if (an_external_name != NULL)
     unique = an_external_name;
 #endif
@@ -1543,6 +1541,7 @@ coff_frob_file_after_relocs (void)
                                                 'r' for read-only data
                                                 's' for shared data (PE)
                                                 'y' for noread
+                                          '0' - '9' for power-of-two alignment (GNU extension).
    But if the argument is not a quoted string, treat it as a
    subsegment number.
 
@@ -1555,6 +1554,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
   /* Strip out the section name.  */
   char *section_name;
   char c;
+  int alignment = -1;
   char *name;
   unsigned int exp;
   flagword flags, oldflags;
@@ -1597,6 +1597,11 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
                 attr != '"'
                 && ! is_end_of_line[attr])
            {
+             if (ISDIGIT (attr))
+               {
+                 alignment = attr - '0';
+                 continue;
+               }
              switch (attr)
                {
                case 'b':
@@ -1673,6 +1678,8 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
     }
 
   sec = subseg_new (name, (subsegT) exp);
+  if (alignment >= 0)
+    sec->alignment_power = alignment;
 
   oldflags = bfd_get_section_flags (stdoutput, sec);
   if (oldflags == SEC_NO_FLAGS)
@@ -1723,17 +1730,18 @@ coff_frob_section (segT sec)
   segT strsec;
   char *p;
   fragS *fragp;
-  bfd_vma size, n_entries, mask;
-  bfd_vma align_power = (bfd_vma)sec->alignment_power + OCTETS_PER_BYTE_POWER;
+  bfd_vma n_entries;
 
   /* The COFF back end in BFD requires that all section sizes be
      rounded up to multiples of the corresponding section alignments,
      supposedly because standard COFF has no other way of encoding alignment
      for sections.  If your COFF flavor has a different way of encoding
      section alignment, then skip this step, as TICOFF does.  */
-  size = bfd_get_section_size (sec);
-  mask = ((bfd_vma) 1 << align_power) - 1;
+  bfd_vma size = bfd_get_section_size (sec);
 #if !defined(TICOFF)
+  bfd_vma align_power = (bfd_vma) sec->alignment_power + OCTETS_PER_BYTE_POWER;
+  bfd_vma mask = ((bfd_vma) 1 << align_power) - 1;
+
   if (size & mask)
     {
       bfd_vma new_size;
@@ -1930,5 +1938,6 @@ const struct format_ops coff_format_ops =
   coff_pop_insert,
   0,   /* ecoff_set_ext */
   coff_obj_read_begin_hook,
-  coff_obj_symbol_new_hook
+  coff_obj_symbol_new_hook,
+  coff_obj_symbol_clone_hook
 };
This page took 0.026894 seconds and 4 git commands to generate.