aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1997-12-13 00:58:43 +0000
committerFred Fish <fnf@specifix.com>1997-12-13 00:58:43 +0000
commit599ef811c38c8ef3fc46bce3b738d455b618eb28 (patch)
treece68d7748414f8e010a07c6227260c2aa41b938c /gas
parentc2a45746f854f92eb9d65eb73c45dba7773ee2e6 (diff)
downloadgdb-599ef811c38c8ef3fc46bce3b738d455b618eb28.zip
gdb-599ef811c38c8ef3fc46bce3b738d455b618eb28.tar.gz
gdb-599ef811c38c8ef3fc46bce3b738d455b618eb28.tar.bz2
* config/tc-tic80.c (build_insn): Handle instructions that have
long (32 bit) PC relative offsets. Fix places that previously misused R_MPPCR for 15 bit offsets to use the new R_MPPCR15W type. (md_apply_fix): Add case to handle long PC relative offsets. PR 12927
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/config/tc-tic80.c51
2 files changed, 44 insertions, 16 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 23a6bde..bb094b8 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+start-sanitize-tic80
+Fri Dec 12 11:44:20 1997 Fred Fish <fnf@cygnus.com>
+
+ * config/tc-tic80.c (build_insn): Handle instructions that have
+ long (32 bit) PC relative offsets. Fix places that previously
+ misused R_MPPCR for 15 bit offsets to use the new R_MPPCR15W type.
+ (md_apply_fix): Add case to handle long PC relative offsets.
+
+end-sanitize-tic80
Fri Dec 12 10:35:01 1997 Nick Clifton <nickc@cygnus.com>
* doc/c-arm.texi (ARM Options): Document support for new ARM
diff --git a/gas/config/tc-tic80.c b/gas/config/tc-tic80.c
index 9c33eaa..b77681d 100644
--- a/gas/config/tc-tic80.c
+++ b/gas/config/tc-tic80.c
@@ -635,26 +635,38 @@ build_insn (opcode, opers)
}
break;
case O_symbol:
- if (flags & TIC80_OPERAND_PCREL)
+ if (bits == 32)
+ {
+ fx = frag_more (4);
+ fxfrag = frag_now;
+ insn[1] = 0;
+ if (flags & TIC80_OPERAND_PCREL)
+ {
+ fix_new_exp (fxfrag,
+ fx - (fxfrag -> fr_literal),
+ 4,
+ &opers[expi],
+ 1,
+ R_MPPCR);
+ }
+ else
+ {
+ fix_new_exp (fxfrag,
+ fx - (fxfrag -> fr_literal),
+ 4,
+ &opers[expi],
+ 0,
+ R_RELLONGX);
+ }
+ }
+ else if (flags & TIC80_OPERAND_PCREL)
{
fix_new_exp (ffrag,
f - (ffrag -> fr_literal),
4, /* FIXME! how is this used? */
&opers[expi],
1,
- R_MPPCR);
- }
- else if (bits == 32) /* was (flags & TIC80_OPERAND_BASEREL) */
- {
- fx = frag_more (4);
- fxfrag = frag_now;
- insn[1] = 0;
- fix_new_exp (fxfrag,
- fx - (fxfrag -> fr_literal),
- 4,
- &opers[expi],
- 0,
- R_RELLONGX);
+ R_MPPCR15W);
}
else
{
@@ -931,10 +943,17 @@ md_apply_fix (fixP, val)
md_number_to_chars (dest, (valueT) val, 4);
break;
case R_MPPCR:
- overflow = (val < -65536) || (val > 65532);
+ val >>= 2;
+ val += 1; /* Target address computed from inst start */
+ md_number_to_chars (dest, (valueT) val, 4);
+ break;
+ case R_MPPCR15W:
+ overflow = (val < -65536L) || (val > 65532L);
if (overflow)
{
- as_bad_where (fixP -> fx_file, fixP -> fx_line, "PC relative target out of range");
+ as_bad_where (fixP -> fx_file, fixP -> fx_line,
+ "PC offset 0x%lx outside range 0x%lx-0x%lx",
+ val, -65536L, 65532L);
}
else
{