From 6e3fcdf01cff0f8e518b594ba5be4e063d00169f Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 30 Oct 1997 21:44:05 +0000 Subject: [PATCH] Fixes to Thumb ADR pseudo op from Tony Thompson at ARM (athompso@arm.com). --- gas/ChangeLog | 5 +++++ gas/config/tc-arm.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 4882f8be353..fe306211e45 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 30 13:46:20 1997 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Fix thumb ADR pseudo op. Patch + from Tony Thompson at ARM: athompso@arm.com + start-sanitize-d30v Thu Oct 30 11:11:26 1997 Michael Meissner diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index dcfa7962120..1a4a3f4601c 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -4566,7 +4566,7 @@ do_t_adr (str) while (*str == ' ') str++; - if (reg_required_here (&str, 8) == FAIL + if (reg_required_here (&str, 4) == FAIL || skip_past_comma (&str) == FAIL || my_get_expression (&inst.reloc.exp, &str)) { @@ -4945,7 +4945,8 @@ md_apply_fix3 (fixP, val, seg) segT seg; { offsetT value = *val; - offsetT newval, temp; + offsetT newval; + unsigned long temp; int sign; char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; arm_fix_data *arm_data = (arm_fix_data *) fixP->tc_fix_data; @@ -5283,6 +5284,7 @@ md_apply_fix3 (fixP, val, seg) as_bad_where (fixP->fx_file, fixP->fx_line, "Invalid immediate for address calculation (value = 0x%08X)", value); newval = (rs == REG_PC ? T_OPCODE_ADD_PC : T_OPCODE_ADD_SP); + newval |= rd << 8; newval |= value >> 2; } else if (rs == rd) -- 2.30.2