diff options
author | Ken Raeburn <raeburn@cygnus> | 1994-02-07 21:12:03 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@cygnus> | 1994-02-07 21:12:03 +0000 |
commit | cf272f02440a64d4665a128a9d8ba33c666769f7 (patch) | |
tree | 3d453ef91c27a565f88a0d2bd08af741636bfba7 | |
parent | bf9691352518be8012225aa9440d1e67aafce77a (diff) | |
download | gdb-cf272f02440a64d4665a128a9d8ba33c666769f7.zip gdb-cf272f02440a64d4665a128a9d8ba33c666769f7.tar.gz gdb-cf272f02440a64d4665a128a9d8ba33c666769f7.tar.bz2 |
(load_expression): Parenthesize operations in range checking, to avoid
precedence questions.
(addr32): New static variable.
(md_parse_option): Set it for "-32addr".
(load_symbol_address): If addr32 is set, use ldl instead of ldq.
-rw-r--r-- | gas/config/tc-alpha.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 0ca87ca..743e9be 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -87,6 +87,12 @@ unsigned long alpha_gprmask, alpha_fprmask; /* Used for LITUSE relocations. */ static expressionS lituse_basereg, lituse_byteoff, lituse_jsr; +/* Address size: In OSF/1 1.3, an undocumented "-32addr" option will + cause all addresses to be treated as 32-bit values in memory. (The + in-register versions are all sign-extended to 64 bits, of course.) + Some other systems may want this option too. */ +static int addr32; + /* Imported functions -- they should be defined in header files somewhere. */ extern segT subseg_get (); extern PTR bfd_alloc_by_size_t (); @@ -713,10 +719,16 @@ load_symbol_address (reg, insn) /* Overflow? */ as_fatal ("overflow in literal (.lita) table"); x = retval; - insn->opcode = (0xa4000000 /* ldq */ - | (reg << SA) - | (base_register << SB) - | (x & 0xffff)); + if (addr32) + insn->opcode = (0xa0000000 /* ldl */ + | (reg << SA) + | (base_register << SB) + | (x & 0xffff)); + else + insn->opcode = (0xa4000000 /* ldq */ + | (reg << SA) + | (base_register << SB) + | (x & 0xffff)); note_gpreg (base_register); } @@ -748,7 +760,7 @@ load_expression (reg, insn) num_insns++; { valueT x = addend; - if (x & ~0x7fff != 0 + if ((x & ~0x7fff) != 0 && (x & ~0x7fff) + 0x8000 != 0) { as_bad ("assembler not prepared to handle constants >16 bits yet"); @@ -1612,6 +1624,12 @@ md_parse_option (argP, cntP, vecP) return 1; } #endif + if (!strcmp (*argP, "32addr")) + { + addr32 = 1; + *argP += 6; + return 1; + } if (!strcmp (*argP, "nocpp")) { *argP += 5; |