aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2002-08-12 08:33:42 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2002-08-12 08:33:42 +0000
commitfdb987ee01ed911144681463cceca4ad666a13ee (patch)
tree0e9bde465710e8b5f0800275d3f60ed8b5e8835c /gas/config/tc-mips.c
parentcf1d5986d85095b2ad2be56bdda9246693ca556a (diff)
downloadgdb-fdb987ee01ed911144681463cceca4ad666a13ee.zip
gdb-fdb987ee01ed911144681463cceca4ad666a13ee.tar.gz
gdb-fdb987ee01ed911144681463cceca4ad666a13ee.tar.bz2
[gas/]
* config/tc-mips.c (mips_ip): Don't work out the value of constant %hi()s here. [gas/testsuite/] * gas/mips/elf-consthilo.[sd]: New test. * gas/mips/mips.exp: Run it.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 54e2540..6fea63a 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -8525,9 +8525,11 @@ mips_ip (str, ip)
{
if (c != S_EX_LO)
{
- if (imm_expr.X_op == O_constant)
- imm_expr.X_add_number =
- (imm_expr.X_add_number >> 16) & 0xffff;
+ if (c == S_EX_HI)
+ {
+ *imm_reloc = BFD_RELOC_HI16_S;
+ imm_unmatched_hi = true;
+ }
#ifdef OBJ_ELF
else if (c == S_EX_HIGHEST)
*imm_reloc = BFD_RELOC_MIPS_HIGHEST;
@@ -8553,11 +8555,6 @@ mips_ip (str, ip)
}
}
#endif
- else if (c == S_EX_HI)
- {
- *imm_reloc = BFD_RELOC_HI16_S;
- imm_unmatched_hi = true;
- }
else
*imm_reloc = BFD_RELOC_HI16;
}
@@ -8658,10 +8655,7 @@ mips_ip (str, ip)
{
if (c != S_EX_LO)
{
- if (imm_expr.X_op == O_constant)
- imm_expr.X_add_number =
- (imm_expr.X_add_number >> 16) & 0xffff;
- else if (c == S_EX_HI)
+ if (c == S_EX_HI)
{
*imm_reloc = BFD_RELOC_HI16_S;
imm_unmatched_hi = true;
@@ -8695,9 +8689,9 @@ mips_ip (str, ip)
else if (imm_expr.X_op == O_constant)
imm_expr.X_add_number &= 0xffff;
}
- if (imm_expr.X_op == O_constant
- && (imm_expr.X_add_number < 0
- || imm_expr.X_add_number >= 0x10000))
+ else if (imm_expr.X_op == O_constant
+ && (imm_expr.X_add_number < 0
+ || imm_expr.X_add_number >= 0x10000))
as_bad (_("lui expression not in range 0..65535"));
s = expr_end;
continue;