aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-10-06 17:31:31 +0000
committerIan Lance Taylor <ian@airs.com>1993-10-06 17:31:31 +0000
commit80aab57939a0e22d4614fa759433c1713f047033 (patch)
tree3a3afbb30c1b9aca4b1ce9c5c957a511b303e96a /gas/config
parent9978cd4dc9134185ff8be094db9d74ca2b545713 (diff)
downloadgdb-80aab57939a0e22d4614fa759433c1713f047033.zip
gdb-80aab57939a0e22d4614fa759433c1713f047033.tar.gz
gdb-80aab57939a0e22d4614fa759433c1713f047033.tar.bz2
Changes to let cons handle bignums like general expressions.
* expr.h (expressionS): New field X_unsigned. * expr.c (operand): Initialize X_unsigned to 1. Set it to 0 for unary minus case. (expr) Fix typo resultP to right if missing operand. Set X_unsigned to 1 when building new expression. * read.c (potable): Make "octa" and "quad" call cons, not big_cons. (cons): Handle bignums. If given an O_constant (small integer) to fill a big space, turn it into a bignum. (parse_bitfield_cons): Set X_unsigned field. (bignum_low, bignum_limit, bignum_high, grow_bignum, big_cons): Removed. * read.h (big_cons): Remove prototype. * symbols.c (resolve_symbol_value): Don't give a warning if a symbol in expr_section can not be resolved. (S_SET_VALUE): Clear X_unsigned. * write.c (write_object_file): If resolve_symbol_value failed on a symbol we are writing out, give a warning. * config/tc-h8500.c (parse_reglist): Set X_unsigned. * config/tc-hppa.c (md_pseudo_table): Change "octa" and "quad" to call pa_cons, not pa_big_cons. (pa_big_cons): Remove. * config/tc-hppa.h (pa_big_cons): Remove declaration. * config/tc-i960.c (md_pseudo_table): Change "quad" to call cons, not big_cons.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-h8500.c1
-rw-r--r--gas/config/tc-hppa.c128
-rw-r--r--gas/config/tc-i960.c95
3 files changed, 78 insertions, 146 deletions
diff --git a/gas/config/tc-h8500.c b/gas/config/tc-h8500.c
index f58163f..0210436 100644
--- a/gas/config/tc-h8500.c
+++ b/gas/config/tc-h8500.c
@@ -421,6 +421,7 @@ parse_reglist (src, op)
op->exp.X_op_symbol = 0;
op->exp.X_add_number = mask;
op->exp.X_op = O_constant;
+ op->exp.X_unsigned = 1;
op->type = IMM8;
return idx;
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index 665606c..f48a352 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -233,8 +233,8 @@ const pseudo_typeS
{"LONG", pa_cons, 4},
{"lsym", pa_lsym, 0},
{"LSYM", pa_lsym, 0},
- {"octa", pa_big_cons, 16},
- {"OCTA", pa_big_cons, 16},
+ {"octa", pa_cons, 16},
+ {"OCTA", pa_cons, 16},
{"org", pa_origin, 0},
{"ORG", pa_origin, 0},
{"origin", pa_origin, 0},
@@ -245,8 +245,8 @@ const pseudo_typeS
{"PROC", pa_proc, 0},
{"procend", pa_procend, 0},
{"PROCEND", pa_procend, 0},
- {"quad", pa_big_cons, 8},
- {"QUAD", pa_big_cons, 8},
+ {"quad", pa_cons, 8},
+ {"QUAD", pa_cons, 8},
{"reg", pa_equ, 1}, /* very similar to .equ */
{"REG", pa_equ, 1}, /* very similar to .equ */
{"short", pa_cons, 2},
@@ -732,7 +732,7 @@ md_begin ()
{
const char *name = pa_opcodes[i].name;
retval = hash_insert (op_hash, name, &pa_opcodes[i]);
- if (retval != NULL && *retval != '\0')
+ if (retval != NULL)
{
as_fatal ("Internal error: can't hash `%s': %s\n",
pa_opcodes[i].name, retval);
@@ -4291,13 +4291,13 @@ s_seg ()
if (strncmp (input_line_pointer, "\"text\"", 6) == 0)
{
input_line_pointer += 6;
- s_text ();
+ s_text (0);
return;
}
if (strncmp (input_line_pointer, "\"data\"", 6) == 0)
{
input_line_pointer += 6;
- s_data ();
+ s_data (0);
return;
}
if (strncmp (input_line_pointer, "\"data1\"", 7) == 0)
@@ -4317,22 +4317,14 @@ s_private ()
register int temp;
temp = get_absolute_expression ();
-#ifdef OBJ_SOM
- subseg_new (SEG_DATA, (subsegT) temp);
-#else
- subseg_new (".data", (subsegT) temp);
-#endif
+ subseg_set (data_section, (subsegT) temp);
demand_empty_rest_of_line ();
}
void
s_data1 ()
{
-#ifdef OBJ_SOM
- subseg_new (SEG_DATA, 1);
-#else
- subseg_new (".data", 1);
-#endif
+ subseg_set (data_section, 1);
demand_empty_rest_of_line ();
return;
}
@@ -4498,7 +4490,7 @@ pa_build_unwind_subspace (call_info)
save_seg = now_seg;
save_subseg = now_subseg;
- subseg_new ((char *) seg->name, subseg);
+ subseg_set (seg, subseg);
unwindP = (char *) &call_info->ci_unwind;
p = frag_more (4);
@@ -4567,7 +4559,7 @@ pa_build_unwind_subspace (call_info)
}
}
- subseg_new ((char *) save_seg->name, save_subseg);
+ subseg_set (save_seg, save_subseg);
}
#else
@@ -4625,7 +4617,7 @@ pa_build_unwind_subspace (call_info)
save_seg = now_seg;
save_subseg = now_subseg;
- subseg_new (seg, subseg);
+ subseg_set (seg, subseg);
unwindP = (char *) &call_info->ci_unwind;
p = frag_more (4);
@@ -4710,7 +4702,7 @@ pa_build_unwind_subspace (call_info)
}
}
- subseg_new (save_seg, save_subseg);
+ subseg_set (save_seg, save_subseg);
}
@@ -4834,13 +4826,8 @@ pa_code ()
}
SPACE_DEFINED (sdchain) = 1;
-#ifdef OBJ_SOM
- subseg_new (SEG_TEXT, SUBSEG_CODE);
-#else
-
- subseg_new (".text", SUBSEG_CODE);
-#endif
+ subseg_set (text_section, SUBSEG_CODE);
demand_empty_rest_of_line ();
return;
@@ -5210,7 +5197,7 @@ void
seg,
SEC_HAS_CONTENTS | SEC_READONLY | SEC_ALLOC | SEC_LOAD);
- subseg_new(save_seg->name, save_subseg);
+ subseg_set(save_seg, save_subseg);
}
#endif
@@ -5520,7 +5507,7 @@ pa_leave ()
void
pa_origin ()
{
- s_org (); /* ORG actually allows another argument
+ s_org (0); /* ORG actually allows another argument
(the fill value) but maybe this is OK? */
pa_undefine_label ();
return;
@@ -5787,11 +5774,7 @@ pa_parse_space_stmt (space_name, create_flag)
void
pa_align_subseg (seg, subseg)
-#ifdef OBJ_SOM
segT seg;
-#else
- asection *seg;
-#endif
subsegT subseg;
{
subspace_dict_chainS *now_subspace;
@@ -5841,22 +5824,12 @@ pa_space ()
current_space = sd_chain;
SPACE_DEFINED (current_space) = 1;
current_space->sd_defined = 1;
-#ifdef OBJ_SOM
- if (now_seg != SEG_TEXT) /* no need to align if we are already there */
-#else
if (now_seg != text_section) /* no need to align if we are already there */
-#endif
pa_align_subseg (now_seg, now_subseg);
-#ifdef OBJ_SOM
- subseg_new (SEG_TEXT, sd_chain->sd_last_subseg);
- current_subspace = pa_subsegment_to_subspace (SEG_TEXT,
- sd_chain->sd_last_subseg);
-#else
- subseg_new ((char *) text_section->name, sd_chain->sd_last_subseg);
+ subseg_set (text_section, sd_chain->sd_last_subseg);
current_subspace = pa_subsegment_to_subspace (text_section,
sd_chain->sd_last_subseg);
-#endif
demand_empty_rest_of_line ();
return;
}
@@ -5872,21 +5845,11 @@ pa_space ()
current_space = sd_chain;
SPACE_DEFINED (current_space) = 1;
current_space->sd_defined = 1;
-#ifdef OBJ_SOM
- if (now_seg != SEG_DATA) /* no need to align if we are already there */
-#else
if (now_seg != data_section) /* no need to align if we are already there */
-#endif
pa_align_subseg (now_seg, now_subseg);
-#ifdef OBJ_SOM
- subseg_new (SEG_DATA, sd_chain->sd_last_subseg);
- current_subspace = pa_subsegment_to_subspace (SEG_DATA,
- sd_chain->sd_last_subseg);
-#else
- subseg_new ((char *) data_section->name, sd_chain->sd_last_subseg);
+ subseg_set (data_section, sd_chain->sd_last_subseg);
current_subspace = pa_subsegment_to_subspace (data_section,
sd_chain->sd_last_subseg);
-#endif
demand_empty_rest_of_line ();
return;
}
@@ -5903,19 +5866,22 @@ pa_space ()
current_space = sd_chain;
SPACE_DEFINED (current_space) = 1;
current_space->sd_defined = 1;
+
#ifdef OBJ_SOM
- if (now_seg != SEG_GDB) /* no need to align if we are already there */
+ if (now_seg != SEG_GDB) /* no need to align if we are already there */
+
pa_align_subseg (now_seg, now_subseg);
- subseg_new (SEG_GDB, sd_chain->sd_last_subseg);
+ subseg_set (SEG_GDB, sd_chain->sd_last_subseg);
current_subspace = pa_subsegment_to_subspace (SEG_GDB,
sd_chain->sd_last_subseg);
#else
{
- asection *gdb_section
- = bfd_make_section_old_way (stdoutput, GDB_DEBUG_SPACE_NAME);
- if (now_seg != gdb_section) /* no need to align if we are already there */
+ segT gdb_section;
+ /* no need to align if we are already there */
+ if (strcmp (segment_name (now_seg), GDB_DEBUG_SPACE_NAME) != 0)
pa_align_subseg (now_seg, now_subseg);
- subseg_new ((char *) gdb_section->name, sd_chain->sd_last_subseg);
+ gdb_section = subseg_new (GDB_DEBUG_SPACE_NAME,
+ sd_chain->sd_last_subseg);
current_subspace = pa_subsegment_to_subspace (gdb_section,
sd_chain->sd_last_subseg);
}
@@ -5935,11 +5901,7 @@ pa_space ()
current_space->sd_defined = 1;
if (now_seg != sd_chain->sd_seg) /* don't align if we're already there */
pa_align_subseg (now_seg, now_subseg);
-#ifdef OBJ_SOM
- subseg_new (sd_chain->sd_seg, sd_chain->sd_last_subseg);
-#else
- subseg_new ((char *) sd_chain->sd_seg->name, sd_chain->sd_last_subseg);
-#endif
+ subseg_set (sd_chain->sd_seg, sd_chain->sd_last_subseg);
current_subspace = pa_subsegment_to_subspace (sd_chain->sd_seg,
sd_chain->sd_last_subseg);
demand_empty_rest_of_line ();
@@ -5961,11 +5923,7 @@ pa_space ()
current_space->sd_defined = 1;
if (now_seg != sd_chain->sd_seg) /* don't align if we're already there */
pa_align_subseg (now_seg, now_subseg);
-#ifdef OBJ_SOM
- subseg_new (sd_chain->sd_seg, sd_chain->sd_last_subseg);
-#else
- subseg_new ((char *) sd_chain->sd_seg->name, sd_chain->sd_last_subseg);
-#endif
+ subseg_set (sd_chain->sd_seg, sd_chain->sd_last_subseg);
current_subspace = pa_subsegment_to_subspace (sd_chain->sd_seg,
sd_chain->sd_last_subseg);
demand_empty_rest_of_line ();
@@ -6068,7 +6026,7 @@ pa_subspace ()
if (ssd->ssd_defined)
{
#ifdef OBJ_SOM
- subseg_new (now_seg, ssd->ssd_subseg);
+ subseg_set (now_seg, ssd->ssd_subseg);
#else
/* subseg_new(now_seg->name,ssd->ssd_subseg); */
subseg_new ((char *) ssd->ssd_seg->name, ssd->ssd_subseg);
@@ -6202,11 +6160,7 @@ pa_subspace ()
SUBSPACE_SUBSPACE_START (current_subspace) = pa_subspace_start (space, quadrant);
demand_empty_rest_of_line ();
-#ifdef OBJ_SOM
- subseg_new (current_subspace->ssd_seg, current_subspace->ssd_subseg);
-#else
- subseg_new ((char *) current_subspace->ssd_seg->name, current_subspace->ssd_subseg);
-#endif
+ subseg_set (current_subspace->ssd_seg, current_subspace->ssd_subseg);
}
return;
}
@@ -6887,7 +6841,7 @@ pa_cons (nbytes)
void
pa_data ()
{
- s_data ();
+ s_data (0);
pa_undefine_label ();
}
@@ -6912,7 +6866,7 @@ pa_float_cons (float_type)
void
pa_fill ()
{
- s_fill ();
+ s_fill (0);
pa_undefine_label ();
}
@@ -6929,22 +6883,14 @@ pa_lcomm (needs_align)
void
pa_lsym ()
{
- s_lsym ();
- pa_undefine_label ();
-}
-
-void
-pa_big_cons (nbytes)
- register int nbytes;
-{
- big_cons (nbytes);
+ s_lsym (0);
pa_undefine_label ();
}
void
pa_text ()
{
- s_text ();
+ s_text (0);
pa_undefine_label ();
}
@@ -7043,7 +6989,7 @@ bfd * abfd;
/* now, switch back to the original segment */
- subseg_new(save_seg->name, save_subseg);
+ subseg_set(save_seg, save_subseg);
return;
}
@@ -7073,6 +7019,6 @@ hppa_tc_make_symextn_section()
bfd_set_section_size (stdoutput, symextn_sec, size);
/* now, switch back to the original segment */
- subseg_new(save_seg->name, save_subseg);
+ subseg_set(save_seg, save_subseg);
}
}
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index be54da4..4c045be 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -201,7 +201,7 @@ const pseudo_typeS md_pseudo_table[] =
{"sysproc", parse_po, S_SYSPROC},
{"word", cons, 4},
- {"quad", big_cons, 16},
+ {"quad", cons, 16},
{0, 0, 0}
};
@@ -508,41 +508,31 @@ md_begin ()
{
int i; /* Loop counter */
const struct i960_opcode *oP; /* Pointer into opcode table */
- char *retval; /* Value returned by hash functions */
+ const char *retval; /* Value returned by hash functions */
if (((op_hash = hash_new ()) == 0)
|| ((reg_hash = hash_new ()) == 0)
|| ((areg_hash = hash_new ()) == 0))
- {
- as_fatal ("virtual memory exceeded");
- }
+ as_fatal ("virtual memory exceeded");
/* For some reason, the base assembler uses an empty string for "no
error message", instead of a NULL pointer. */
retval = "";
- for (oP = i960_opcodes; oP->name && !*retval; oP++)
- {
- retval = hash_insert (op_hash, oP->name, oP);
- }
+ for (oP = i960_opcodes; oP->name && !retval; oP++)
+ retval = hash_insert (op_hash, oP->name, (PTR) oP);
- for (i = 0; regnames[i].reg_name && !*retval; i++)
- {
- retval = hash_insert (reg_hash, regnames[i].reg_name,
- &regnames[i].reg_num);
- }
+ for (i = 0; regnames[i].reg_name && !retval; i++)
+ retval = hash_insert (reg_hash, regnames[i].reg_name,
+ &regnames[i].reg_num);
- for (i = 0; aregs[i].areg_name && !*retval; i++)
- {
- retval = hash_insert (areg_hash, aregs[i].areg_name,
- &aregs[i].areg_num);
- }
+ for (i = 0; aregs[i].areg_name && !retval; i++)
+ retval = hash_insert (areg_hash, aregs[i].areg_name,
+ &aregs[i].areg_num);
- if (*retval)
- {
- as_fatal ("Hashing returned \"%s\".", retval);
- }
-} /* md_begin() */
+ if (retval)
+ as_fatal ("Hashing returned \"%s\".", retval);
+}
/*****************************************************************************
* md_end: One-time final cleanup
@@ -577,7 +567,6 @@ md_assemble (textP)
char *args[4];
int n_ops; /* Number of instruction operands */
- int callx;
/* Pointer to instruction description */
struct i960_opcode *oP;
/* TRUE iff opcode mnemonic included branch-prediction
@@ -896,7 +885,7 @@ md_number_to_field (instrP, val, bfixP)
if (((val < 0) && (sign != -1))
|| ((val > 0) && (sign != 0)))
{
- as_bad ("Fixup of %d too large for field width of %d",
+ as_bad ("Fixup of %ld too large for field width of %d",
val, numbits);
}
else
@@ -964,14 +953,14 @@ md_parse_option (argP, cntP, vecP)
};
static struct tabentry arch_tab[] =
{
- "KA", ARCH_KA,
- "KB", ARCH_KB,
- "SA", ARCH_KA, /* Synonym for KA */
- "SB", ARCH_KB, /* Synonym for KB */
- "KC", ARCH_MC, /* Synonym for MC */
- "MC", ARCH_MC,
- "CA", ARCH_CA,
- NULL, 0
+ { "KA", ARCH_KA },
+ { "KB", ARCH_KB },
+ { "SA", ARCH_KA }, /* Synonym for KA */
+ { "SB", ARCH_KB }, /* Synonym for KB */
+ { "KC", ARCH_MC }, /* Synonym for MC */
+ { "MC", ARCH_MC },
+ { "CA", ARCH_CA },
+ { NULL, 0 }
};
struct tabentry *tp;
if (!strcmp (*argP, "linkrelax"))
@@ -2220,7 +2209,7 @@ parse_po (po_num)
/* Advance input pointer to end of line. */
p = input_line_pointer;
- while (!is_end_of_line[*input_line_pointer])
+ while (!is_end_of_line[(unsigned char) *input_line_pointer])
{
input_line_pointer++;
}
@@ -2458,22 +2447,22 @@ struct
coj[] =
{ /* COBR OPCODE: */
- CHKBIT, BNO, /* 0x30 - bbc */
- CMPO, BG, /* 0x31 - cmpobg */
- CMPO, BE, /* 0x32 - cmpobe */
- CMPO, BGE, /* 0x33 - cmpobge */
- CMPO, BL, /* 0x34 - cmpobl */
- CMPO, BNE, /* 0x35 - cmpobne */
- CMPO, BLE, /* 0x36 - cmpoble */
- CHKBIT, BO, /* 0x37 - bbs */
- CMPI, BNO, /* 0x38 - cmpibno */
- CMPI, BG, /* 0x39 - cmpibg */
- CMPI, BE, /* 0x3a - cmpibe */
- CMPI, BGE, /* 0x3b - cmpibge */
- CMPI, BL, /* 0x3c - cmpibl */
- CMPI, BNE, /* 0x3d - cmpibne */
- CMPI, BLE, /* 0x3e - cmpible */
- CMPI, BO, /* 0x3f - cmpibo */
+ { CHKBIT, BNO }, /* 0x30 - bbc */
+ { CMPO, BG }, /* 0x31 - cmpobg */
+ { CMPO, BE }, /* 0x32 - cmpobe */
+ { CMPO, BGE }, /* 0x33 - cmpobge */
+ { CMPO, BL }, /* 0x34 - cmpobl */
+ { CMPO, BNE }, /* 0x35 - cmpobne */
+ { CMPO, BLE }, /* 0x36 - cmpoble */
+ { CHKBIT, BO }, /* 0x37 - bbs */
+ { CMPI, BNO }, /* 0x38 - cmpibno */
+ { CMPI, BG }, /* 0x39 - cmpibg */
+ { CMPI, BE }, /* 0x3a - cmpibe */
+ { CMPI, BGE }, /* 0x3b - cmpibge */
+ { CMPI, BL }, /* 0x3c - cmpibl */
+ { CMPI, BNE }, /* 0x3d - cmpibne */
+ { CMPI, BLE }, /* 0x3e - cmpible */
+ { CMPI, BO }, /* 0x3f - cmpibo */
};
static
@@ -3174,10 +3163,6 @@ i960_handle_align (fragp)
fragS *fragp;
{
fixS *fixp;
- segT old_seg = now_seg, this_seg;
- int old_subseg = now_subseg;
- int pad_size;
- extern struct frag *text_last_frag, *data_last_frag;
if (!linkrelax)
return;