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] [AIX] [GAS] .lcomm directive


AIX 6.1 assembler added an optional alignment argument to the .lcomm
pseudo-op and GCC uses it (it is necessary for vectors allocated in
BSS).  Is the following patch the correct approach to accept that
argument?

Thanks, David

Index: tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.202
diff -c -p -r1.202 tc-ppc.c
*** tc-ppc.c    24 Jul 2013 14:12:41 -0000      1.202
--- tc-ppc.c    13 Aug 2013 21:41:34 -0000
*************** ppc_comm (int lcomm)
*** 3526,3536 ****
        char *lcomm_name;
        char lcomm_endc;

-       if (size <= 4)
-       align = 2;
-       else
-       align = 3;
-
        /* The third argument to .lcomm appears to be the real local
         common symbol to create.  References to the symbol named in
         the first argument are turned into references to the third
--- 3526,3531 ----
*************** ppc_comm (int lcomm)
*** 3549,3554 ****
--- 3544,3568 ----
        lcomm_sym = symbol_find_or_make (lcomm_name);

        *input_line_pointer = lcomm_endc;
+
+       /* The fourth argument to .lcomm is the alignment.  */
+       if (*input_line_pointer != ',')
+       {
+         if (size <= 4)
+           align = 2;
+         else
+           align = 3;
+       }
+       else
+       {
+         ++input_line_pointer;
+         align = get_absolute_expression ();
+         if (align <= 0)
+           {
+             as_warn (_("ignoring bad alignment"));
+             align = 2;
+           }
+       }
      }

    *end_name = '\0';


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