diff options
author | Claudiu Zissulescu <claziss@synopsys.com> | 2016-04-05 16:22:19 +0200 |
---|---|---|
committer | Claudiu Zissulescu <claziss@synopsys.com> | 2016-04-05 16:23:02 +0200 |
commit | 6ec1f28285f0a24587f7b5935e6d3fd4011fbb01 (patch) | |
tree | 09f79d150e5e1992804eb4f10eae871273a9ad26 /gas/config | |
parent | 1f599d0e7b5039c814731293043e247304ec006b (diff) | |
download | gdb-6ec1f28285f0a24587f7b5935e6d3fd4011fbb01.zip gdb-6ec1f28285f0a24587f7b5935e6d3fd4011fbb01.tar.gz gdb-6ec1f28285f0a24587f7b5935e6d3fd4011fbb01.tar.bz2 |
[ARC] Don't allow pc-rel relocations for J* instructions.
gas/
2016-04-05 Claudiu Zissulescu <claziss@synopsys.com>
* config/tc-arc.c (assemble_insn): Prohibit pc-rel relocations for
JUMP instructions type.
* testsuite/gas/arc/relocs-errors.d: New file.
* testsuite/gas/arc/relocs-errors.err: Likewise.
* testsuite/gas/arc/relocs-errors.s: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-arc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 4f9c336..40643ad 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -3363,6 +3363,10 @@ assemble_insn (const struct arc_opcode *opcode, switch (t->X_md) { case O_plt: + if (opcode->class == JUMP) + as_bad_where (frag_now->fr_file, frag_now->fr_line, + _("Unable to use @plt relocatio for insn %s"), + opcode->name); needGOTSymbol = TRUE; reloc = find_reloc ("plt", opcode->name, pflags, nflg, @@ -3376,7 +3380,7 @@ assemble_insn (const struct arc_opcode *opcode, break; case O_pcl: reloc = ARC_RELOC_TABLE (t->X_md)->reloc; - if (ARC_SHORT (opcode->mask)) + if (ARC_SHORT (opcode->mask) || opcode->class == JUMP) as_bad_where (frag_now->fr_file, frag_now->fr_line, _("Unable to use @pcl relocation for insn %s"), opcode->name); |