* read.c (TC_IMPLICIT_LCOMM_ALIGNMENT): New default-definition.
authorHans-Peter Nilsson <hp@axis.com>
Mon, 13 Mar 2000 20:46:07 +0000 (20:46 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Mon, 13 Mar 2000 20:46:07 +0000 (20:46 +0000)
(s_lcomm_internal): Use it.
* doc/internals.texi (CPU backend): Document it.
* config/obj-evax.h (TC_IMPLICIT_LCOMM_ALIGNMENT): Set to 2**3
bytes.

gas/ChangeLog
gas/config/obj-evax.h
gas/doc/internals.texi
gas/read.c

index 83d680a2e6ccf8d0eadb287db910f2379f889b73..a238d8ae81a565b1f77816b44f2b52130c54832d 100644 (file)
@@ -1,3 +1,11 @@
+Sat Mar 11 00:01:39 2000  Hans-Peter Nilsson  <hp@axis.se>
+
+       * read.c (TC_IMPLICIT_LCOMM_ALIGNMENT): New default-definition.
+       (s_lcomm_internal): Use it.
+       * doc/internals.texi (CPU backend): Document it.
+       * config/obj-evax.h (TC_IMPLICIT_LCOMM_ALIGNMENT): Set to 2**3
+       bytes.
+
 2000-03-10  Geoffrey Keating  <geoffk@cygnus.com>
 
        * config/tc-mips.c (mips_ip): Don't put stuff in .rodata
index 1d9db19f41bac69671df28348057dfa2d1d113ab..745b1feff9760a5a90f0e0f10598ca193f0983df 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is obj-evax.h
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 2000 Free Software Foundation, Inc.
    Contributed by Klaus Kämpf (kkaempf@progis.de) of
      proGIS Software, Aachen, Germany.
 
@@ -85,6 +85,8 @@ typedef void *object_headers;
 
 #define LKP_S_K_SIZE 16
 
+#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) (P2VAR) = 3
+
 /*
  * Local Variables:
  * comment-column: 0
index 6fbc9bba6585565fd7ea1e72cf1ffc24fdb2e62f..1e05131df7a002146aee485aea751b7c12367b35 100644 (file)
@@ -1059,6 +1059,16 @@ upon the number of bytes that the alignment will skip.
 You may define this macro to do special handling for an alignment directive.
 GAS will call it at the end of the assembly.
 
+@item TC_IMPLICIT_LCOMM_ALIGNMENT (@var{size}, @var{p2var})
+@cindex TC_IMPLICIT_LCOMM_ALIGNMENT
+An @code{.lcomm} directive with no explicit alignment parameter will use this
+macro to set @var{p2var} to the alignment that a request for @var{size} bytes
+will have.  The alignment is expressed as a power of two.  If no alignment
+should take place, the macro definition should do nothing.  Some targets define
+a @code{.bss} directive that is also affected by this macro.  The default
+definition will set @var{p2var} to the truncated power of two of sizes up to
+eight bytes.
+
 @item md_flush_pending_output
 @cindex md_flush_pending_output
 If you define this macro, GAS will call it each time it skips any space because of a
index 71dae8e42e8b72d92b560be9f5f151d81d160fe4..b8afe1c2e24a2be2a22cbd1122de732be2e0656f 100644 (file)
@@ -53,6 +53,21 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define TC_START_LABEL(x,y) (x==':')
 #endif
 
+/* Set by the object-format or the target.  */
+#ifndef TC_IMPLICIT_LCOMM_ALIGNMENT
+#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR)        \
+ do {                                                   \
+  if ((SIZE) >= 8)                                      \
+    (P2VAR) = 3;                                        \
+  else if ((SIZE) >= 4)                                 \
+    (P2VAR) = 2;                                        \
+  else if ((SIZE) >= 2)                                 \
+    (P2VAR) = 1;                                        \
+  else                                                  \
+    (P2VAR) = 0;                                        \
+ } while (0)
+#endif
+
 /* The NOP_OPCODE is for the alignment fill value.
  * fill it a nop instruction so that the disassembler does not choke
  * on it
@@ -1973,24 +1988,14 @@ s_lcomm_internal (needs_align, bytes_p)
        }
     }
 #endif
+
    if (!needs_align)
      {
-       /* FIXME. This needs to be machine independent. */
-       if (temp >= 8)
-        align = 3;
-       else if (temp >= 4)
-        align = 2;
-       else if (temp >= 2)
-        align = 1;
-       else
-        align = 0;
-
-#ifdef OBJ_EVAX
-       /* FIXME: This needs to be done in a more general fashion.  */
-       align = 3;
-#endif
+       TC_IMPLICIT_LCOMM_ALIGNMENT (temp, align);
 
-       record_alignment(bss_seg, align);
+       /* Still zero unless TC_IMPLICIT_LCOMM_ALIGNMENT set it.  */
+       if (align)
+         record_alignment(bss_seg, align);
      }
 
   if (needs_align)