aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJohn Darrington <john@darrington.wattle.id.au>2019-01-16 14:34:50 +0100
committerJohn Darrington <john@darrington.wattle.id.au>2019-01-16 14:39:04 +0100
commitd5dcaf1b59e77047e10a1f246095d6b21f7d9772 (patch)
treef0849cbdc103770465bd83bf4905515b0191b270 /gas
parent338c923d26fa86f695fcdc4b659a5f0772768093 (diff)
downloadgdb-d5dcaf1b59e77047e10a1f246095d6b21f7d9772.zip
gdb-d5dcaf1b59e77047e10a1f246095d6b21f7d9772.tar.gz
gdb-d5dcaf1b59e77047e10a1f246095d6b21f7d9772.tar.bz2
S12Z: Emit RELOC_S12Z_OPR instead of RELOC_EXT24 where appropriate.
When assembling instructions which involve OPR references, emit RELOC_S12Z_OPR instead of RELOC_EXT24. bfd/ * bfd-in2.h [BFD_RELOC_S12Z_OPR]: New reloc. * libbfd.h: regen. * elf32-s12z.c (eld_s12z_howto_table): R_S12Z_OPR takes non zero source field. (md_apply_fix): Apply final fix to BFD_RELOC_S12Z_OPR. * reloc.c[BFD_RELOC_S12Z_OPR]: New reloc. gas/ * config/tc-s12z.c (emit_opr): Emit BFD_RELOC_S12Z_OPR instead of BFD_RELOC_24. * testsuite/gas/s12z/opr-indirect-expr.d: Expect R_S12Z_OPR instead of R_S12Z_EXT24.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-s12z.c18
-rw-r--r--gas/testsuite/gas/s12z/opr-indirect-expr.d2
3 files changed, 20 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index abc0923..986af84 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2019-01-16 John Darrington <john@darrington.wattle.id.au>
+
+ * config/tc-s12z.c (emit_opr): Emit BFD_RELOC_S12Z_OPR instead of
+ BFD_RELOC_24.
+ * testsuite/gas/s12z/opr-indirect-expr.d: Expect R_S12Z_OPR instead
+ of R_S12Z_EXT24.
+
2019-01-14 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
* config/tc-arm.c (arm_ext_v6k_v6t2): Define.
diff --git a/gas/config/tc-s12z.c b/gas/config/tc-s12z.c
index 2f98c04..7d1ddf6 100644
--- a/gas/config/tc-s12z.c
+++ b/gas/config/tc-s12z.c
@@ -732,12 +732,17 @@ emit_opr (char *f, const uint8_t *buffer, int n_bytes, expressionS *exp)
number_to_chars_bigendian (f++, buffer[0], 1);
if (exp->X_op != O_absent && exp->X_op != O_constant)
{
- fix_new_exp (frag_now,
- f - frag_now->fr_literal,
- 3,
- exp,
- FALSE,
- BFD_RELOC_24);
+ fixS *fix = fix_new_exp (frag_now,
+ f - frag_now->fr_literal,
+ 3,
+ exp,
+ FALSE,
+ BFD_RELOC_S12Z_OPR);
+ /* Some third party tools seem to use the lower bits
+ of this addend for flags. They don't get added
+ to the final location. The purpose of these flags
+ is not known. We simply set it to zero. */
+ fix->fx_addnumber = 0x00;
}
for (i = 1; i < n_bytes; ++i)
number_to_chars_bigendian (f++, buffer[i], 1);
@@ -3821,6 +3826,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
bfd_putb16 ((bfd_vma) value, (unsigned char *) where);
break;
case BFD_RELOC_24:
+ case BFD_RELOC_S12Z_OPR:
bfd_putb24 ((bfd_vma) value, (unsigned char *) where);
break;
case BFD_RELOC_32:
diff --git a/gas/testsuite/gas/s12z/opr-indirect-expr.d b/gas/testsuite/gas/s12z/opr-indirect-expr.d
index f7a1fcd..8facde5 100644
--- a/gas/testsuite/gas/s12z/opr-indirect-expr.d
+++ b/gas/testsuite/gas/s12z/opr-indirect-expr.d
@@ -11,4 +11,4 @@ Disassembly of section .text:
00000000 <.text>:
0: a7 fe 00 00 ld d7, \[1\]
4: 01
- 2: R_S12Z_EXT24 FOO
+ 2: R_S12Z_OPR FOO