aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-02-21 08:39:53 +0000
committerAlan Modra <amodra@gmail.com>2005-02-21 08:39:53 +0000
commitcc1bc22af7e433b5cfca0907e069ffbeb8a29660 (patch)
tree9a33febbcc7d92442b4bb902a93c96be671faf1f /gas/read.c
parent2562953678f04d6574d5dffdbc41242e5b487ff5 (diff)
downloadfsf-binutils-gdb-cc1bc22af7e433b5cfca0907e069ffbeb8a29660.zip
fsf-binutils-gdb-cc1bc22af7e433b5cfca0907e069ffbeb8a29660.tar.gz
fsf-binutils-gdb-cc1bc22af7e433b5cfca0907e069ffbeb8a29660.tar.bz2
gas/
* read.c (address_bytes): New function. (TC_ADDRESS_BYTES): Default for BSD_ASSEMBLER to address_bytes. (potable): Add "dc.a". (cons_worker): Handle "dc.a". * doc/internals.texi (TC_ADDRESS_BYTES): Document. ld/testsuite/ * ld-elf/exclude1.s: Use ".dc.a". * ld-elfvsb/hidden2.s: Likewise.
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gas/read.c b/gas/read.c
index 807f410..c86b7d7 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -243,6 +243,24 @@ read_begin (void)
lex_type['?'] = 3;
}
+#ifndef TC_ADDRESS_BYTES
+#ifdef BFD_ASSEMBLER
+#define TC_ADDRESS_BYTES address_bytes
+
+static inline int
+address_bytes (void)
+{
+ /* Choose smallest of 1, 2, 4, 8 bytes that is large enough to
+ contain an address. */
+ int n = (stdoutput->arch_info->bits_per_address - 1) / 8;
+ n |= n >> 1;
+ n |= n >> 2;
+ n += 1;
+ return n;
+}
+#endif
+#endif
+
/* Set up pseudo-op tables. */
static struct hash_control *po_hash;
@@ -263,6 +281,9 @@ static const pseudo_typeS potable[] = {
{"common.s", s_mri_common, 1},
{"data", s_data, 0},
{"dc", cons, 2},
+#ifdef TC_ADDRESS_BYTES
+ {"dc.a", cons, 0},
+#endif
{"dc.b", cons, 1},
{"dc.d", float_cons, 'd'},
{"dc.l", cons, 4},
@@ -3335,6 +3356,11 @@ cons_worker (register int nbytes, /* 1=.byte, 2=.word, 4=.long. */
return;
}
+#ifdef TC_ADDRESS_BYTES
+ if (nbytes == 0)
+ nbytes = TC_ADDRESS_BYTES ();
+#endif
+
#ifdef md_cons_align
md_cons_align (nbytes);
#endif