aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2000-03-13 20:46:07 +0000
committerHans-Peter Nilsson <hp@axis.com>2000-03-13 20:46:07 +0000
commit8684e216c83d214d6f896cacb420a2a7699e6690 (patch)
tree1b99a13d6a20a14f565dc74340d4dfbf65d21998
parent0fff5247b5e7a5006f4adea7fe67a51b53c89929 (diff)
downloadgdb-8684e216c83d214d6f896cacb420a2a7699e6690.zip
gdb-8684e216c83d214d6f896cacb420a2a7699e6690.tar.gz
gdb-8684e216c83d214d6f896cacb420a2a7699e6690.tar.bz2
* 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.
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/obj-evax.h4
-rw-r--r--gas/doc/internals.texi10
-rw-r--r--gas/read.c35
4 files changed, 41 insertions, 16 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 83d680a..a238d8a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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
diff --git a/gas/config/obj-evax.h b/gas/config/obj-evax.h
index 1d9db19..745b1fe 100644
--- a/gas/config/obj-evax.h
+++ b/gas/config/obj-evax.h
@@ -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
diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi
index 6fbc9bb..1e05131 100644
--- a/gas/doc/internals.texi
+++ b/gas/doc/internals.texi
@@ -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
diff --git a/gas/read.c b/gas/read.c
index 71dae8e..b8afe1c 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -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)