2001-02-19 07:33:11 +08:00
|
|
|
|
/* tc-pdp11.c - pdp11-specific -
|
2024-01-04 19:52:08 +08:00
|
|
|
|
Copyright (C) 2001-2024 Free Software Foundation, Inc.
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
This file is part of GAS, the GNU Assembler.
|
|
|
|
|
|
|
|
|
|
GAS is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-07-03 19:01:12 +08:00
|
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
|
|
GAS is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with GAS; see the file COPYING. If not, write to
|
2009-02-03 18:58:46 +08:00
|
|
|
|
the Free Software Foundation, 51 Franklin Street - Fifth Floor,
|
|
|
|
|
Boston, MA 02110-1301, USA. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
#include "as.h"
|
2001-09-19 13:33:36 +08:00
|
|
|
|
#include "safe-ctype.h"
|
2001-02-19 07:33:11 +08:00
|
|
|
|
#include "opcode/pdp11.h"
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
extern int flonum_gen2vax (int, FLONUM_TYPE * f, LITTLENUM_TYPE *);
|
2002-03-05 11:10:34 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* A representation for PDP-11 machine code. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
struct pdp11_code
|
|
|
|
|
{
|
2016-04-01 20:07:50 +08:00
|
|
|
|
const char *error;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
int code;
|
2005-03-23 19:18:14 +08:00
|
|
|
|
int additional; /* Is there an additional word? */
|
|
|
|
|
int word; /* Additional word, if any. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
struct
|
|
|
|
|
{
|
|
|
|
|
bfd_reloc_code_real_type type;
|
|
|
|
|
expressionS exp;
|
|
|
|
|
int pc_rel;
|
|
|
|
|
} reloc;
|
|
|
|
|
};
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* Instruction set extensions.
|
|
|
|
|
|
|
|
|
|
If you change this from an array to something else, please update
|
|
|
|
|
the "PDP-11 instruction set extensions" comment in pdp11.h. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
int pdp11_extension[PDP11_EXT_NUM];
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* Assembly options. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
#define ASM_OPT_PIC 1
|
|
|
|
|
#define ASM_OPT_NUM 2
|
|
|
|
|
|
|
|
|
|
int asm_option[ASM_OPT_NUM];
|
|
|
|
|
|
|
|
|
|
/* These chars start a comment anywhere in a source file (except inside
|
2005-03-23 19:18:14 +08:00
|
|
|
|
another comment. */
|
2002-06-08 15:37:16 +08:00
|
|
|
|
const char comment_chars[] = "#/";
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2001-02-21 08:04:47 +08:00
|
|
|
|
/* These chars only start a comment at the beginning of a line. */
|
2002-06-08 15:37:16 +08:00
|
|
|
|
const char line_comment_chars[] = "#/";
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2002-06-08 15:37:16 +08:00
|
|
|
|
const char line_separator_chars[] = ";";
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* Chars that can be used to separate mant from exp in floating point nums. */
|
2002-06-08 15:37:16 +08:00
|
|
|
|
const char EXP_CHARS[] = "eE";
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* Chars that mean this number is a floating point constant. */
|
|
|
|
|
/* as in 0f123.456. */
|
|
|
|
|
/* or 0H1.234E-12 (see exp chars above). */
|
2002-06-08 15:37:16 +08:00
|
|
|
|
const char FLT_CHARS[] = "dDfF";
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
void pseudo_even (int);
|
|
|
|
|
void pseudo_bss (int);
|
|
|
|
|
|
2002-06-08 15:37:16 +08:00
|
|
|
|
const pseudo_typeS md_pseudo_table[] =
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
{ "bss", pseudo_bss, 0 },
|
|
|
|
|
{ "even", pseudo_even, 0 },
|
|
|
|
|
{ 0, 0, 0 },
|
|
|
|
|
};
|
|
|
|
|
|
2020-08-18 16:57:21 +08:00
|
|
|
|
static htab_t insn_hash = NULL;
|
2005-03-23 19:18:14 +08:00
|
|
|
|
|
|
|
|
|
static int
|
2016-02-27 22:35:32 +08:00
|
|
|
|
set_option (const char *arg)
|
2005-03-23 19:18:14 +08:00
|
|
|
|
{
|
|
|
|
|
int yes = 1;
|
|
|
|
|
|
|
|
|
|
if (strcmp (arg, "all-extensions") == 0
|
|
|
|
|
|| strcmp (arg, "all") == 0)
|
|
|
|
|
{
|
|
|
|
|
memset (pdp11_extension, ~0, sizeof pdp11_extension);
|
|
|
|
|
pdp11_extension[PDP11_NONE] = 0;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (arg, "no-extensions") == 0)
|
|
|
|
|
{
|
|
|
|
|
memset (pdp11_extension, 0, sizeof pdp11_extension);
|
|
|
|
|
pdp11_extension[PDP11_BASIC] = 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (startswith (arg, "no-"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
{
|
|
|
|
|
yes = 0;
|
|
|
|
|
arg += 3;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-23 23:23:07 +08:00
|
|
|
|
/* Commercial instructions. */
|
2005-03-23 19:18:14 +08:00
|
|
|
|
if (strcmp (arg, "cis") == 0)
|
|
|
|
|
pdp11_extension[PDP11_CIS] = yes;
|
|
|
|
|
/* Call supervisor mode. */
|
|
|
|
|
else if (strcmp (arg, "csm") == 0)
|
|
|
|
|
pdp11_extension[PDP11_CSM] = yes;
|
|
|
|
|
/* Extended instruction set. */
|
|
|
|
|
else if (strcmp (arg, "eis") == 0)
|
|
|
|
|
pdp11_extension[PDP11_EIS] = pdp11_extension[PDP11_LEIS] = yes;
|
|
|
|
|
/* KEV11 floating-point. */
|
|
|
|
|
else if (strcmp (arg, "fis") == 0
|
|
|
|
|
|| strcmp (arg, "kev11") == 0
|
|
|
|
|
|| strcmp (arg, "kev-11") == 0)
|
|
|
|
|
pdp11_extension[PDP11_FIS] = yes;
|
|
|
|
|
/* FP-11 floating-point. */
|
|
|
|
|
else if (strcmp (arg, "fpp") == 0
|
|
|
|
|
|| strcmp (arg, "fpu") == 0
|
|
|
|
|
|| strcmp (arg, "fp11") == 0
|
|
|
|
|
|| strcmp (arg, "fp-11") == 0
|
|
|
|
|
|| strcmp (arg, "fpj11") == 0
|
|
|
|
|
|| strcmp (arg, "fp-j11") == 0
|
|
|
|
|
|| strcmp (arg, "fpj-11") == 0)
|
|
|
|
|
pdp11_extension[PDP11_FPP] = yes;
|
|
|
|
|
/* Limited extended insns. */
|
|
|
|
|
else if (strcmp (arg, "limited-eis") == 0)
|
|
|
|
|
{
|
|
|
|
|
pdp11_extension[PDP11_LEIS] = yes;
|
|
|
|
|
if (!pdp11_extension[PDP11_LEIS])
|
|
|
|
|
pdp11_extension[PDP11_EIS] = 0;
|
|
|
|
|
}
|
|
|
|
|
/* Move from processor type. */
|
|
|
|
|
else if (strcmp (arg, "mfpt") == 0)
|
|
|
|
|
pdp11_extension[PDP11_MFPT] = yes;
|
|
|
|
|
/* Multiprocessor insns: */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (arg, "mproc")
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* TSTSET, WRTLCK */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
|| startswith (arg, "multiproc"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
pdp11_extension[PDP11_MPROC] = yes;
|
|
|
|
|
/* Move from/to proc status. */
|
|
|
|
|
else if (strcmp (arg, "mxps") == 0)
|
|
|
|
|
pdp11_extension[PDP11_MXPS] = yes;
|
|
|
|
|
/* Position-independent code. */
|
|
|
|
|
else if (strcmp (arg, "pic") == 0)
|
|
|
|
|
asm_option[ASM_OPT_PIC] = yes;
|
|
|
|
|
/* Set priority level. */
|
|
|
|
|
else if (strcmp (arg, "spl") == 0)
|
|
|
|
|
pdp11_extension[PDP11_SPL] = yes;
|
|
|
|
|
/* Microcode instructions: */
|
|
|
|
|
else if (strcmp (arg, "ucode") == 0
|
|
|
|
|
/* LDUB, MED, XFC */
|
|
|
|
|
|| strcmp (arg, "microcode") == 0)
|
|
|
|
|
pdp11_extension[PDP11_UCODE] = yes;
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
static void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
init_defaults (void)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
static int first = 1;
|
|
|
|
|
|
|
|
|
|
if (first)
|
|
|
|
|
{
|
|
|
|
|
set_option ("all-extensions");
|
|
|
|
|
set_option ("pic");
|
|
|
|
|
first = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_begin (void)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
init_defaults ();
|
|
|
|
|
|
2020-08-18 16:57:21 +08:00
|
|
|
|
insn_hash = str_htab_create ();
|
2001-02-21 08:04:47 +08:00
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
for (i = 0; i < pdp11_num_opcodes; i++)
|
PR26513, 629310abec breaks assembling PowerPC Linux kernels
Inserting with replacement is wrong for some gas hash table uses.
This patch implements an htab_insert that conditionally replaces, and
similarly for str_hash_insert. str_hash_insert with replace=0 is
roughly equivalent to the older hash_insert, and str_hash_insert with
replace=1 to the older hash_jam, but return values are different. I
found it useful to know whether the slot was occupied prior to
inserting/replacing. I've also reinstated the fatal errors on messing
up opcode tables with duplicates.
PR 26513
* hash.h (htab_insert): Update prototype and comment.
(struct string_tuple): Make "value" a const void*.
(string_tuple_alloc): Likewise.
(str_hash_find, str_hash_find_n): Cast returned value.
(str_hash_insert): Add "replace" parameter, and return slot pointer.
Free alloc'd element when not inserted.
* hash.c (htab_insert): Likewise. Return slot when element exists,
otherwise return NULL.
* read.c (pop_insert): Insert into hash table without first searching.
* config/tc-avr.c (md_begin): Likewise.
* config/tc-msp430.c (md_begin): Likewise.
* config/tc-nds32.c (nds32_init_nds32_pseudo_opcodes): Likewise.
* config/tc-v850.c (md_begin): Likewise.
* macro.c (do_formals, define_macro, macro_expand_body): Likewise.
(delete_macro): Delete from hash table.
* config/tc-tic54x.c (subsym_create_or_replace): Correct logic.
* symbols.c (local_symbol_make, symbol_table_insert): Allow
replacement of hash table entries.
* config/obj-coff-seh.c (seh_hash_insert): Likewise.
* config/obj-coff.c (tag_insert): Likewise.
* config/tc-iq2000.c (iq2000_add_macro): Likewise.
* config/tc-m68k.c (md_begin): Likewise for aliases.
* config/tc-tic4x.c (tic4x_asg): Likewise.
* config/tc-tic6x.c (md_begin): Likewise.
* dw2gencfi.c (dwcfi_hash_find_or_make): Disallow replacement of
hash table entries.
* ecoff.c (add_string, get_tag): Likewise.
* macro.c (expand_irp): Likewise.
* config/obj-elf.c (build_additional_section_info): Likewise.
* config/tc-aarch64.c (insert_reg_alias): Likewise.
(checked_hash_insert): Likewise.
* config/tc-alpha.c (get_alpha_reloc_tag, md_begin): Likewise.
* config/tc-arc.c (arc_insert_opcode, declare_register): Likewise.
(declare_addrtype, md_begin, arc_extcorereg): Likewise.
* config/tc-arm.c (insert_reg_alias): Likewise.
(arm_tc_equal_in_insn, md_begin): Likewise.
* config/tc-cr16.c (initialise_reg_hash_table, md_begin): Likewise.
* config/tc-cris.c (md_begin): Likewise.
* config/tc-crx.c (md_begin): Likewise.
* config/tc-csky.c (md_begin): Likewise.
* config/tc-d10v.c (md_begin): Likewise.
* config/tc-dlx.c (md_begin): Likewise.
* config/tc-ft32.c (md_begin): Likewise.
* config/tc-h8300.c (md_begin): Likewise.
* config/tc-hppa.c (md_begin): Likewise.
* config/tc-i386.c (md_begin): Likewise.
* config/tc-ia64.c (dot_rot, dot_entry, declare_register): Likewise.
(md_begin, dot_alias): Likewise.
* config/tc-m68hc11.c (md_begin): Likewise.
* config/tc-m68k.c (md_begin): Likewise.
* config/tc-mcore.c (md_begin): Likewise.
* config/tc-microblaze.c (md_begin): Likewise.
* config/tc-mips.c (md_begin): Likewise.
* config/tc-mmix.c (md_begin): Likewise.
* config/tc-mn10200.c (md_begin): Likewise.
* config/tc-mn10300.c (md_begin): Likewise.
* config/tc-moxie.c (md_begin): Likewise.
* config/tc-nds32.c (nds32_relax_hint, md_begin): Likewise.
* config/tc-nios2.c (md_begin): Likewise.
* config/tc-ns32k.c (md_begin): Likewise.
* config/tc-pdp11.c (md_begin): Likewise.
* config/tc-pj.c (fake_opcode, md_begin): Likewise.
* config/tc-ppc.c (ppc_setup_opcodes): Likewise.
* config/tc-pru.c (md_begin): Likewise.
* config/tc-riscv.c (init_ext_version_hash): Likewise.
(init_opcode_names_hash, hash_reg_name, init_opcode_hash): Likewise.
(riscv_init_csr_hash): Likewise.
* config/tc-s390.c (s390_setup_opcodes, md_begin): Likewise.
* config/tc-score.c (s3_insert_reg): Likewise.
(s3_build_score_ops_hsh, s3_build_dependency_insn_hsh): Likewise.
* config/tc-score7.c (s7_build_score_ops_hsh): Likewise.
(s7_build_dependency_insn_hsh, s7_insert_reg): Likewise.
* config/tc-sh.c (md_begin): Likewise.
* config/tc-sparc.c (md_begin): Likewise.
* config/tc-spu.c (md_begin): Likewise.
* config/tc-tic30.c (md_begin): Likewise.
* config/tc-tic4x.c (tic4x_inst_insert): Likewise.
* config/tc-tic54x.c (stag_add_field_symbols, md_begin): Likewise.
(tic54x_endstruct, tic54x_var, tic54x_macro_info): Likewise.
(subsym_substitute): Likewise.
* config/tc-tilegx.c (md_begin): Likewise.
* config/tc-tilepro.c (md_begin): Likewise.
* config/tc-vax.c (vip_begin): Likewise.
* config/tc-wasm32.c (md_begin): Likewise.
* config/tc-xgate.c (md_begin): Likewise.
* config/tc-z8k.c (md_begin): Likewise.
* testsuite/gas/ppc/dcbt.d,
* testsuite/gas/ppc/dcbt.s: New test.
* testsuite/gas/ppc/ppc.exp: Run it.
* ecoff.c (add_string): Report fatal error on duplicates.
* config/tc-alpha.c (md_begin): Likewise.
* config/tc-arc.c (arc_insert_opcode, declare_register): Likewise.
(declare_addrtype, md_begin, arc_extcorereg): Likewise.
* config/tc-cr16.c (initialise_reg_hash_table, md_begin): Likewise.
* config/tc-cris.c (md_begin): Likewise.
* config/tc-crx.c (md_begin): Likewise.
* config/tc-dlx.c (md_begin): Likewise.
* config/tc-hppa.c (md_begin): Likewise.
* config/tc-i386.c (md_begin): Likewise.
* config/tc-ia64.c (dot_rot, dot_entry, declare_register): Likewise.
(md_begin): Likewise.
* config/tc-m68k.c (md_begin): Likewise.
* config/tc-mips.c (md_begin): Likewise.
* config/tc-nios2.c (md_begin): Likewise.
* config/tc-ns32k.c (md_begin): Likewise.
* config/tc-ppc.c (ppc_setup_opcodes): Likewise.
* config/tc-pru.c (md_begin): Likewise.
* config/tc-riscv.c (init_ext_version_hash): Likewise.
(init_opcode_names_hash, hash_reg_name, init_opcode_hash): Likewise.
* config/tc-s390.c (s390_setup_opcodes, md_begin): Likewise.
* config/tc-sparc.c (md_begin): Likewise.
* config/tc-tic30.c (md_begin): Likewise.
* config/tc-tic4x.c (tic4x_inst_insert): Likewise.
* config/tc-tilegx.c (md_begin): Likewise.
* config/tc-tilepro.c (md_begin): Likewise.
* config/tc-vax.c (vip_begin): Likewise.
* config/tc-alpha.c,
* config/tc-arm.c,
* config/tc-avr.c,
* config/tc-cr16.c,
* config/tc-csky.c,
* config/tc-i386.c,
* config/tc-m68hc11.c,
* config/tc-m68k.c,
* config/tc-microblaze.c,
* config/tc-ns32k.c,
* config/tc-pj.c,
* config/tc-ppc.c,
* config/tc-score.c,
* config/tc-score7.c,
* config/tc-tic4x.c,
* config/tc-tic54x.c,
* config/tc-tilegx.c,
* config/tc-tilepro.c,
* config/tc-xgate.c: Formatting.
2020-08-22 16:29:57 +08:00
|
|
|
|
str_hash_insert (insn_hash, pdp11_opcodes[i].name, pdp11_opcodes + i, 0);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
for (i = 0; i < pdp11_num_aliases; i++)
|
PR26513, 629310abec breaks assembling PowerPC Linux kernels
Inserting with replacement is wrong for some gas hash table uses.
This patch implements an htab_insert that conditionally replaces, and
similarly for str_hash_insert. str_hash_insert with replace=0 is
roughly equivalent to the older hash_insert, and str_hash_insert with
replace=1 to the older hash_jam, but return values are different. I
found it useful to know whether the slot was occupied prior to
inserting/replacing. I've also reinstated the fatal errors on messing
up opcode tables with duplicates.
PR 26513
* hash.h (htab_insert): Update prototype and comment.
(struct string_tuple): Make "value" a const void*.
(string_tuple_alloc): Likewise.
(str_hash_find, str_hash_find_n): Cast returned value.
(str_hash_insert): Add "replace" parameter, and return slot pointer.
Free alloc'd element when not inserted.
* hash.c (htab_insert): Likewise. Return slot when element exists,
otherwise return NULL.
* read.c (pop_insert): Insert into hash table without first searching.
* config/tc-avr.c (md_begin): Likewise.
* config/tc-msp430.c (md_begin): Likewise.
* config/tc-nds32.c (nds32_init_nds32_pseudo_opcodes): Likewise.
* config/tc-v850.c (md_begin): Likewise.
* macro.c (do_formals, define_macro, macro_expand_body): Likewise.
(delete_macro): Delete from hash table.
* config/tc-tic54x.c (subsym_create_or_replace): Correct logic.
* symbols.c (local_symbol_make, symbol_table_insert): Allow
replacement of hash table entries.
* config/obj-coff-seh.c (seh_hash_insert): Likewise.
* config/obj-coff.c (tag_insert): Likewise.
* config/tc-iq2000.c (iq2000_add_macro): Likewise.
* config/tc-m68k.c (md_begin): Likewise for aliases.
* config/tc-tic4x.c (tic4x_asg): Likewise.
* config/tc-tic6x.c (md_begin): Likewise.
* dw2gencfi.c (dwcfi_hash_find_or_make): Disallow replacement of
hash table entries.
* ecoff.c (add_string, get_tag): Likewise.
* macro.c (expand_irp): Likewise.
* config/obj-elf.c (build_additional_section_info): Likewise.
* config/tc-aarch64.c (insert_reg_alias): Likewise.
(checked_hash_insert): Likewise.
* config/tc-alpha.c (get_alpha_reloc_tag, md_begin): Likewise.
* config/tc-arc.c (arc_insert_opcode, declare_register): Likewise.
(declare_addrtype, md_begin, arc_extcorereg): Likewise.
* config/tc-arm.c (insert_reg_alias): Likewise.
(arm_tc_equal_in_insn, md_begin): Likewise.
* config/tc-cr16.c (initialise_reg_hash_table, md_begin): Likewise.
* config/tc-cris.c (md_begin): Likewise.
* config/tc-crx.c (md_begin): Likewise.
* config/tc-csky.c (md_begin): Likewise.
* config/tc-d10v.c (md_begin): Likewise.
* config/tc-dlx.c (md_begin): Likewise.
* config/tc-ft32.c (md_begin): Likewise.
* config/tc-h8300.c (md_begin): Likewise.
* config/tc-hppa.c (md_begin): Likewise.
* config/tc-i386.c (md_begin): Likewise.
* config/tc-ia64.c (dot_rot, dot_entry, declare_register): Likewise.
(md_begin, dot_alias): Likewise.
* config/tc-m68hc11.c (md_begin): Likewise.
* config/tc-m68k.c (md_begin): Likewise.
* config/tc-mcore.c (md_begin): Likewise.
* config/tc-microblaze.c (md_begin): Likewise.
* config/tc-mips.c (md_begin): Likewise.
* config/tc-mmix.c (md_begin): Likewise.
* config/tc-mn10200.c (md_begin): Likewise.
* config/tc-mn10300.c (md_begin): Likewise.
* config/tc-moxie.c (md_begin): Likewise.
* config/tc-nds32.c (nds32_relax_hint, md_begin): Likewise.
* config/tc-nios2.c (md_begin): Likewise.
* config/tc-ns32k.c (md_begin): Likewise.
* config/tc-pdp11.c (md_begin): Likewise.
* config/tc-pj.c (fake_opcode, md_begin): Likewise.
* config/tc-ppc.c (ppc_setup_opcodes): Likewise.
* config/tc-pru.c (md_begin): Likewise.
* config/tc-riscv.c (init_ext_version_hash): Likewise.
(init_opcode_names_hash, hash_reg_name, init_opcode_hash): Likewise.
(riscv_init_csr_hash): Likewise.
* config/tc-s390.c (s390_setup_opcodes, md_begin): Likewise.
* config/tc-score.c (s3_insert_reg): Likewise.
(s3_build_score_ops_hsh, s3_build_dependency_insn_hsh): Likewise.
* config/tc-score7.c (s7_build_score_ops_hsh): Likewise.
(s7_build_dependency_insn_hsh, s7_insert_reg): Likewise.
* config/tc-sh.c (md_begin): Likewise.
* config/tc-sparc.c (md_begin): Likewise.
* config/tc-spu.c (md_begin): Likewise.
* config/tc-tic30.c (md_begin): Likewise.
* config/tc-tic4x.c (tic4x_inst_insert): Likewise.
* config/tc-tic54x.c (stag_add_field_symbols, md_begin): Likewise.
(tic54x_endstruct, tic54x_var, tic54x_macro_info): Likewise.
(subsym_substitute): Likewise.
* config/tc-tilegx.c (md_begin): Likewise.
* config/tc-tilepro.c (md_begin): Likewise.
* config/tc-vax.c (vip_begin): Likewise.
* config/tc-wasm32.c (md_begin): Likewise.
* config/tc-xgate.c (md_begin): Likewise.
* config/tc-z8k.c (md_begin): Likewise.
* testsuite/gas/ppc/dcbt.d,
* testsuite/gas/ppc/dcbt.s: New test.
* testsuite/gas/ppc/ppc.exp: Run it.
* ecoff.c (add_string): Report fatal error on duplicates.
* config/tc-alpha.c (md_begin): Likewise.
* config/tc-arc.c (arc_insert_opcode, declare_register): Likewise.
(declare_addrtype, md_begin, arc_extcorereg): Likewise.
* config/tc-cr16.c (initialise_reg_hash_table, md_begin): Likewise.
* config/tc-cris.c (md_begin): Likewise.
* config/tc-crx.c (md_begin): Likewise.
* config/tc-dlx.c (md_begin): Likewise.
* config/tc-hppa.c (md_begin): Likewise.
* config/tc-i386.c (md_begin): Likewise.
* config/tc-ia64.c (dot_rot, dot_entry, declare_register): Likewise.
(md_begin): Likewise.
* config/tc-m68k.c (md_begin): Likewise.
* config/tc-mips.c (md_begin): Likewise.
* config/tc-nios2.c (md_begin): Likewise.
* config/tc-ns32k.c (md_begin): Likewise.
* config/tc-ppc.c (ppc_setup_opcodes): Likewise.
* config/tc-pru.c (md_begin): Likewise.
* config/tc-riscv.c (init_ext_version_hash): Likewise.
(init_opcode_names_hash, hash_reg_name, init_opcode_hash): Likewise.
* config/tc-s390.c (s390_setup_opcodes, md_begin): Likewise.
* config/tc-sparc.c (md_begin): Likewise.
* config/tc-tic30.c (md_begin): Likewise.
* config/tc-tic4x.c (tic4x_inst_insert): Likewise.
* config/tc-tilegx.c (md_begin): Likewise.
* config/tc-tilepro.c (md_begin): Likewise.
* config/tc-vax.c (vip_begin): Likewise.
* config/tc-alpha.c,
* config/tc-arm.c,
* config/tc-avr.c,
* config/tc-cr16.c,
* config/tc-csky.c,
* config/tc-i386.c,
* config/tc-m68hc11.c,
* config/tc-m68k.c,
* config/tc-microblaze.c,
* config/tc-ns32k.c,
* config/tc-pj.c,
* config/tc-ppc.c,
* config/tc-score.c,
* config/tc-score7.c,
* config/tc-tic4x.c,
* config/tc-tic54x.c,
* config/tc-tilegx.c,
* config/tc-tilepro.c,
* config/tc-xgate.c: Formatting.
2020-08-22 16:29:57 +08:00
|
|
|
|
str_hash_insert (insn_hash, pdp11_aliases[i].name, pdp11_aliases + i, 0);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_number_to_chars (char con[], valueT value, int nbytes)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
/* On a PDP-11, 0x1234 is stored as "\x12\x34", and
|
2005-03-23 19:18:14 +08:00
|
|
|
|
0x12345678 is stored as "\x56\x78\x12\x34". It's
|
2017-01-23 23:23:07 +08:00
|
|
|
|
anyone's guess what 0x123456 would be stored like. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
switch (nbytes)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
con[0] = value & 0xff;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2005-03-23 19:18:14 +08:00
|
|
|
|
con[0] = value & 0xff;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
con[1] = (value >> 8) & 0xff;
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
con[0] = (value >> 16) & 0xff;
|
|
|
|
|
con[1] = (value >> 24) & 0xff;
|
2005-03-23 19:18:14 +08:00
|
|
|
|
con[2] = value & 0xff;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
con[3] = (value >> 8) & 0xff;
|
|
|
|
|
break;
|
2020-09-01 19:53:52 +08:00
|
|
|
|
#ifdef BFD64
|
2020-05-29 01:11:59 +08:00
|
|
|
|
case 8:
|
|
|
|
|
con[0] = (value >> 48) & 0xff;
|
|
|
|
|
con[1] = (value >> 56) & 0xff;
|
|
|
|
|
con[2] = (value >> 32) & 0xff;
|
|
|
|
|
con[3] = (value >> 40) & 0xff;
|
|
|
|
|
con[4] = (value >> 16) & 0xff;
|
|
|
|
|
con[5] = (value >> 24) & 0xff;
|
|
|
|
|
con[6] = value & 0xff;
|
|
|
|
|
con[7] = (value >> 8) & 0xff;
|
|
|
|
|
break;
|
2020-09-01 19:53:52 +08:00
|
|
|
|
#endif
|
2001-02-19 07:33:11 +08:00
|
|
|
|
default:
|
|
|
|
|
BAD_CASE (nbytes);
|
2001-02-21 08:04:47 +08:00
|
|
|
|
}
|
2001-02-19 07:33:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Fix up some data or instructions after we find out the value of a symbol
|
2001-11-16 05:29:00 +08:00
|
|
|
|
that they reference. Knows about order of bytes in address. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2001-11-16 05:29:00 +08:00
|
|
|
|
void
|
gas:
* cgen.c, cgen.h, tc.h, write.c, config/obj-coff.c
* config/tc-a29k.c, config/tc-alpha.c, config/tc-alpha.h
* config/tc-arc.c, config/tc-arc.h, config/tc-arm.c
* config/tc-arm.h, config/tc-avr.c, config/tc-avr.h
* config/tc-cris.c, config/tc-crx.c, config/tc-d10v.c
* config/tc-d10v.h, config/tc-d30v.c, config/tc-d30v.h
* config/tc-dlx.c, config/tc-dlx.h, config/tc-fr30.h
* config/tc-frv.c, config/tc-frv.h, config/tc-h8300.c
* config/tc-h8500.c, config/tc-hppa.c, config/tc-hppa.h
* config/tc-i370.c, config/tc-i370.h, config/tc-i386.c
* config/tc-i386.h, config/tc-i860.c, config/tc-i860.h
* config/tc-i960.c, config/tc-i960.h, config/tc-ia64.c
* config/tc-ip2k.c, config/tc-ip2k.h, config/tc-iq2000.c
* config/tc-iq2000.h, config/tc-m32r.c, config/tc-m32r.h
* config/tc-m68hc11.c, config/tc-m68hc11.h, config/tc-m68k.c
* config/tc-m68k.h, config/tc-m88k.c, config/tc-maxq.c
* config/tc-mcore.c, config/tc-mcore.h, config/tc-mips.c
* config/tc-mips.h, config/tc-mmix.c, config/tc-mn10200.c
* config/tc-mn10300.c, config/tc-msp430.c, config/tc-ns32k.c
* config/tc-openrisc.h, config/tc-or32.c, config/tc-or32.h
* config/tc-pdp11.c, config/tc-pj.c, config/tc-pj.h
* config/tc-ppc.c, config/tc-ppc.h, config/tc-s390.c
* config/tc-s390.h, config/tc-sh64.c, config/tc-sh.c
* config/tc-sh.h, config/tc-sparc.c, config/tc-sparc.h
* config/tc-tahoe.c, config/tc-tic30.c, config/tc-tic4x.c
* config/tc-tic54x.c, config/tc-tic80.c, config/tc-v850.c
* config/tc-v850.h, config/tc-vax.c, config/tc-vax.h
* config/tc-w65.c, config/tc-xstormy16.c, config/tc-xstormy16.h
* config/tc-xtensa.c, config/tc-z8k.c:
Replace all instances of the string "_apply_fix3" with
"_apply_fix".
* po/POTFILES.in, po/gas.pot: Regenerate.
bfd:
* coff-i386.c: Change md_apply_fix3 to md_apply_fix in comment.
cgen:
* doc/porting.texi: Change all mention of md_apply_fix3 and
gas_cgen_md_apply_fix3 to md_apply_fix and gas_cgen_md_apply_fix
respectively.
2005-06-08 01:54:22 +08:00
|
|
|
|
md_apply_fix (fixS *fixP,
|
2005-03-23 19:18:14 +08:00
|
|
|
|
valueT * valP,
|
|
|
|
|
segT seg ATTRIBUTE_UNUSED)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
valueT code;
|
|
|
|
|
valueT mask;
|
2001-11-16 05:29:00 +08:00
|
|
|
|
valueT val = * valP;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
char *buf;
|
|
|
|
|
int shift;
|
|
|
|
|
int size;
|
|
|
|
|
|
|
|
|
|
buf = fixP->fx_where + fixP->fx_frag->fr_literal;
|
|
|
|
|
size = fixP->fx_size;
|
2005-07-05 23:07:46 +08:00
|
|
|
|
code = md_chars_to_number ((unsigned char *) buf, size);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
switch (fixP->fx_r_type)
|
|
|
|
|
{
|
2019-03-20 06:50:55 +08:00
|
|
|
|
case BFD_RELOC_8:
|
|
|
|
|
mask = 0xff;
|
|
|
|
|
shift = 0;
|
|
|
|
|
break;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
case BFD_RELOC_16:
|
|
|
|
|
case BFD_RELOC_16_PCREL:
|
|
|
|
|
mask = 0xffff;
|
|
|
|
|
shift = 0;
|
|
|
|
|
break;
|
2020-02-20 21:05:21 +08:00
|
|
|
|
case BFD_RELOC_32:
|
|
|
|
|
mask = 0xffffffff;
|
|
|
|
|
shift = 0;
|
|
|
|
|
break;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
case BFD_RELOC_PDP11_DISP_8_PCREL:
|
|
|
|
|
mask = 0x00ff;
|
|
|
|
|
shift = 1;
|
|
|
|
|
break;
|
|
|
|
|
case BFD_RELOC_PDP11_DISP_6_PCREL:
|
|
|
|
|
mask = 0x003f;
|
|
|
|
|
shift = 1;
|
2004-10-01 19:19:38 +08:00
|
|
|
|
val = -val;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
BAD_CASE (fixP->fx_r_type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fixP->fx_addsy != NULL)
|
2001-11-16 05:29:00 +08:00
|
|
|
|
val += symbol_get_bfdsym (fixP->fx_addsy)->section->vma;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
/* *value += fixP->fx_addsy->bsym->section->vma; */
|
|
|
|
|
|
|
|
|
|
code &= ~mask;
|
2001-11-16 05:29:00 +08:00
|
|
|
|
code |= (val >> shift) & mask;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
number_to_chars_littleendian (buf, code, size);
|
2001-11-16 05:29:00 +08:00
|
|
|
|
|
|
|
|
|
if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0)
|
|
|
|
|
fixP->fx_done = 1;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
long
|
2016-03-27 16:30:31 +08:00
|
|
|
|
md_chars_to_number (unsigned char *con, int nbytes)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
/* On a PDP-11, 0x1234 is stored as "\x12\x34", and
|
2005-03-23 19:18:14 +08:00
|
|
|
|
0x12345678 is stored as "\x56\x78\x12\x34". It's
|
2017-01-23 23:23:07 +08:00
|
|
|
|
anyone's guess what 0x123456 would be stored like. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
switch (nbytes)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
return 0;
|
|
|
|
|
case 1:
|
|
|
|
|
return con[0];
|
|
|
|
|
case 2:
|
|
|
|
|
return (con[1] << BITS_PER_CHAR) | con[0];
|
|
|
|
|
case 4:
|
|
|
|
|
return
|
2005-03-23 19:18:14 +08:00
|
|
|
|
(((con[1] << BITS_PER_CHAR) | con[0]) << (2 * BITS_PER_CHAR))
|
|
|
|
|
|((con[3] << BITS_PER_CHAR) | con[2]);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
default:
|
|
|
|
|
BAD_CASE (nbytes);
|
|
|
|
|
return 0;
|
2001-02-21 08:04:47 +08:00
|
|
|
|
}
|
2001-02-19 07:33:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
|
skip_whitespace (char *str)
|
|
|
|
|
{
|
|
|
|
|
while (*str == ' ' || *str == '\t')
|
|
|
|
|
str++;
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
|
find_whitespace (char *str)
|
|
|
|
|
{
|
|
|
|
|
while (*str != ' ' && *str != '\t' && *str != 0)
|
|
|
|
|
str++;
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
|
parse_reg (char *str, struct pdp11_code *operand)
|
|
|
|
|
{
|
|
|
|
|
str = skip_whitespace (str);
|
2001-09-19 13:33:36 +08:00
|
|
|
|
if (TOLOWER (*str) == 'r')
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
str++;
|
|
|
|
|
switch (*str)
|
|
|
|
|
{
|
|
|
|
|
case '0': case '1': case '2': case '3':
|
|
|
|
|
case '4': case '5': case '6': case '7':
|
|
|
|
|
operand->code = *str - '0';
|
|
|
|
|
str++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Bad register name");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return str - 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (str, "sp")
|
|
|
|
|
|| startswith (str, "SP"))
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
operand->code = 6;
|
|
|
|
|
str += 2;
|
|
|
|
|
}
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (str, "pc")
|
|
|
|
|
|| startswith (str, "PC"))
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
operand->code = 7;
|
|
|
|
|
str += 2;
|
|
|
|
|
}
|
|
|
|
|
else
|
2020-05-28 09:40:38 +08:00
|
|
|
|
{
|
|
|
|
|
operand->error = _("Bad register name");
|
|
|
|
|
return str;
|
|
|
|
|
}
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2020-05-28 09:40:38 +08:00
|
|
|
|
if (ISALNUM (*str) || *str == '_' || *str == '.')
|
|
|
|
|
{
|
|
|
|
|
operand->error = _("Bad register name");
|
|
|
|
|
str -= 2;
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *
|
2002-03-05 11:10:34 +08:00
|
|
|
|
parse_ac5 (char *str, struct pdp11_code *operand)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
str = skip_whitespace (str);
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (startswith (str, "fr")
|
|
|
|
|
|| startswith (str, "FR")
|
|
|
|
|
|| startswith (str, "ac")
|
|
|
|
|
|| startswith (str, "AC"))
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
str += 2;
|
|
|
|
|
switch (*str)
|
|
|
|
|
{
|
|
|
|
|
case '0': case '1': case '2': case '3':
|
2002-03-05 11:10:34 +08:00
|
|
|
|
case '4': case '5':
|
2001-02-19 07:33:11 +08:00
|
|
|
|
operand->code = *str - '0';
|
|
|
|
|
str++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Bad register name");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return str - 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Bad register name");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-05 11:10:34 +08:00
|
|
|
|
static char *
|
|
|
|
|
parse_ac (char *str, struct pdp11_code *operand)
|
|
|
|
|
{
|
|
|
|
|
str = parse_ac5 (str, operand);
|
|
|
|
|
if (!operand->error && operand->code > 3)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Bad register name");
|
2002-03-05 11:10:34 +08:00
|
|
|
|
return str - 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
static char *
|
|
|
|
|
parse_expression (char *str, struct pdp11_code *operand)
|
|
|
|
|
{
|
|
|
|
|
char *save_input_line_pointer;
|
|
|
|
|
segT seg;
|
|
|
|
|
|
|
|
|
|
save_input_line_pointer = input_line_pointer;
|
|
|
|
|
input_line_pointer = str;
|
|
|
|
|
seg = expression (&operand->reloc.exp);
|
|
|
|
|
if (seg == NULL)
|
|
|
|
|
{
|
|
|
|
|
input_line_pointer = save_input_line_pointer;
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Error in expression");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
str = input_line_pointer;
|
|
|
|
|
input_line_pointer = save_input_line_pointer;
|
|
|
|
|
|
|
|
|
|
operand->reloc.pc_rel = 0;
|
|
|
|
|
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
|
parse_op_no_deferred (char *str, struct pdp11_code *operand)
|
|
|
|
|
{
|
2002-03-05 11:10:34 +08:00
|
|
|
|
LITTLENUM_TYPE literal_float[2];
|
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
|
|
|
|
|
switch (*str)
|
|
|
|
|
{
|
|
|
|
|
case '(': /* (rn) and (rn)+ */
|
|
|
|
|
str = parse_reg (str + 1, operand);
|
|
|
|
|
if (operand->error)
|
|
|
|
|
return str;
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
if (*str != ')')
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Missing ')'");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
str++;
|
|
|
|
|
if (*str == '+')
|
|
|
|
|
{
|
|
|
|
|
operand->code |= 020;
|
|
|
|
|
str++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
operand->code |= 010;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* Immediate. */
|
|
|
|
|
case '#':
|
2001-02-21 08:04:47 +08:00
|
|
|
|
case '$':
|
2001-02-19 07:33:11 +08:00
|
|
|
|
str = parse_expression (str + 1, operand);
|
|
|
|
|
if (operand->error)
|
|
|
|
|
return str;
|
Use bool in gas
* as.h (POISON_BFD_BOOLEAN): Define.
* as.c, * as.h, * atof-generic.c, * config/atof-ieee.c,
* config/bfin-aux.h, * config/obj-coff.c, * config/obj-ecoff.c,
* config/obj-elf.c, * config/obj-elf.h, * config/obj-som.c,
* config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
* config/tc-arc.h, * config/tc-arm.c, * config/tc-arm.h,
* config/tc-avr.c, * config/tc-avr.h, * config/tc-bfin.c,
* config/tc-bfin.h, * config/tc-bpf.c, * config/tc-cris.c,
* config/tc-csky.c, * config/tc-csky.h, * config/tc-d10v.c,
* config/tc-d10v.h, * config/tc-d30v.c, * config/tc-d30v.h,
* config/tc-dlx.c, * config/tc-dlx.h, * config/tc-epiphany.c,
* config/tc-epiphany.h, * config/tc-fr30.c, * config/tc-fr30.h,
* config/tc-frv.c, * config/tc-frv.h, * config/tc-ft32.c,
* config/tc-ft32.h, * config/tc-h8300.c, * config/tc-hppa.c,
* config/tc-i386-intel.c, * config/tc-i386.c, * config/tc-ia64.c,
* config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-iq2000.h,
* config/tc-lm32.c, * config/tc-lm32.h, * config/tc-m32c.c,
* config/tc-m32c.h, * config/tc-m32r.c, * config/tc-m32r.h,
* config/tc-m68hc11.c, * config/tc-m68k.c, * config/tc-mcore.c,
* config/tc-mcore.h, * config/tc-mep.c, * config/tc-mep.h,
* config/tc-metag.c, * config/tc-metag.h,
* config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mips.h,
* config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c,
* config/tc-mn10300.h, * config/tc-moxie.c, * config/tc-msp430.c,
* config/tc-msp430.h, * config/tc-mt.c, * config/tc-mt.h,
* config/tc-nds32.c, * config/tc-nds32.h, * config/tc-nios2.c,
* config/tc-ns32k.c, * config/tc-or1k.c, * config/tc-or1k.h,
* config/tc-pdp11.c, * config/tc-ppc.c, * config/tc-pru.c,
* config/tc-pru.h, * config/tc-riscv.c, * config/tc-riscv.h,
* config/tc-rx.c, * config/tc-rx.h, * config/tc-s12z.c,
* config/tc-s12z.h, * config/tc-s390.c, * config/tc-score.c,
* config/tc-score.h, * config/tc-score7.c, * config/tc-sh.c,
* config/tc-sh.h, * config/tc-spu.c, * config/tc-tic54x.c,
* config/tc-tic6x.c, * config/tc-tic6x.h, * config/tc-tilegx.c,
* config/tc-tilepro.c, * config/tc-v850.c, * config/tc-v850.h,
* config/tc-visium.c, * config/tc-visium.h, * config/tc-wasm32.c,
* config/tc-wasm32.h, * config/tc-xc16x.c, * config/tc-xgate.c,
* config/tc-xstormy16.c, * config/tc-xstormy16.h,
* config/tc-xtensa.c, * config/tc-xtensa.h, * config/tc-z80.c,
* config/tc-z8k.c, * config/xtensa-istack.h,
* config/xtensa-relax.c, * config/xtensa-relax.h, * dw2gencfi.c,
* dwarf2dbg.c, * dwarf2dbg.h, * expr.c, * expr.h, * frags.c,
* frags.h, * listing.c, * macro.c, * output-file.c, * read.c,
* read.h, * stabs.c, * symbols.c, * write.c: Replace bfd_boolean
with bool, FALSE with false, and TRUE with true.
2021-03-31 08:12:05 +08:00
|
|
|
|
operand->additional = true;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
operand->word = operand->reloc.exp.X_add_number;
|
|
|
|
|
switch (operand->reloc.exp.X_op)
|
|
|
|
|
{
|
|
|
|
|
case O_constant:
|
|
|
|
|
break;
|
|
|
|
|
case O_symbol:
|
|
|
|
|
case O_add:
|
|
|
|
|
case O_subtract:
|
|
|
|
|
operand->reloc.type = BFD_RELOC_16;
|
|
|
|
|
operand->reloc.pc_rel = 0;
|
|
|
|
|
break;
|
2002-03-05 11:10:34 +08:00
|
|
|
|
case O_big:
|
|
|
|
|
if (operand->reloc.exp.X_add_number > 0)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Error in expression");
|
2002-03-05 11:10:34 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* It's a floating literal... */
|
2002-03-05 11:10:34 +08:00
|
|
|
|
know (operand->reloc.exp.X_add_number < 0);
|
|
|
|
|
flonum_gen2vax ('f', &generic_floating_point_number, literal_float);
|
|
|
|
|
operand->word = literal_float[0];
|
|
|
|
|
if (literal_float[1] != 0)
|
|
|
|
|
as_warn (_("Low order bits truncated in immediate float operand"));
|
|
|
|
|
break;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
default:
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Error in expression");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
operand->code = 027;
|
|
|
|
|
break;
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* label, d(rn), -(rn) */
|
|
|
|
|
default:
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (startswith (str, "-(")) /* -(rn) */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
str = parse_reg (str + 2, operand);
|
|
|
|
|
if (operand->error)
|
|
|
|
|
return str;
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
if (*str != ')')
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Missing ')'");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
operand->code |= 040;
|
|
|
|
|
str++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
str = parse_expression (str, operand);
|
|
|
|
|
if (operand->error)
|
|
|
|
|
return str;
|
|
|
|
|
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
if (*str != '(')
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
operand->code = 067;
|
|
|
|
|
operand->additional = 1;
|
|
|
|
|
operand->word = 0;
|
|
|
|
|
operand->reloc.type = BFD_RELOC_16_PCREL;
|
|
|
|
|
operand->reloc.pc_rel = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* d(rn) */
|
|
|
|
|
str++;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
str = parse_reg (str, operand);
|
|
|
|
|
if (operand->error)
|
|
|
|
|
return str;
|
|
|
|
|
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
|
|
|
|
|
if (*str != ')')
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Missing ')'");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
str++;
|
Use bool in gas
* as.h (POISON_BFD_BOOLEAN): Define.
* as.c, * as.h, * atof-generic.c, * config/atof-ieee.c,
* config/bfin-aux.h, * config/obj-coff.c, * config/obj-ecoff.c,
* config/obj-elf.c, * config/obj-elf.h, * config/obj-som.c,
* config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
* config/tc-arc.h, * config/tc-arm.c, * config/tc-arm.h,
* config/tc-avr.c, * config/tc-avr.h, * config/tc-bfin.c,
* config/tc-bfin.h, * config/tc-bpf.c, * config/tc-cris.c,
* config/tc-csky.c, * config/tc-csky.h, * config/tc-d10v.c,
* config/tc-d10v.h, * config/tc-d30v.c, * config/tc-d30v.h,
* config/tc-dlx.c, * config/tc-dlx.h, * config/tc-epiphany.c,
* config/tc-epiphany.h, * config/tc-fr30.c, * config/tc-fr30.h,
* config/tc-frv.c, * config/tc-frv.h, * config/tc-ft32.c,
* config/tc-ft32.h, * config/tc-h8300.c, * config/tc-hppa.c,
* config/tc-i386-intel.c, * config/tc-i386.c, * config/tc-ia64.c,
* config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-iq2000.h,
* config/tc-lm32.c, * config/tc-lm32.h, * config/tc-m32c.c,
* config/tc-m32c.h, * config/tc-m32r.c, * config/tc-m32r.h,
* config/tc-m68hc11.c, * config/tc-m68k.c, * config/tc-mcore.c,
* config/tc-mcore.h, * config/tc-mep.c, * config/tc-mep.h,
* config/tc-metag.c, * config/tc-metag.h,
* config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mips.h,
* config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c,
* config/tc-mn10300.h, * config/tc-moxie.c, * config/tc-msp430.c,
* config/tc-msp430.h, * config/tc-mt.c, * config/tc-mt.h,
* config/tc-nds32.c, * config/tc-nds32.h, * config/tc-nios2.c,
* config/tc-ns32k.c, * config/tc-or1k.c, * config/tc-or1k.h,
* config/tc-pdp11.c, * config/tc-ppc.c, * config/tc-pru.c,
* config/tc-pru.h, * config/tc-riscv.c, * config/tc-riscv.h,
* config/tc-rx.c, * config/tc-rx.h, * config/tc-s12z.c,
* config/tc-s12z.h, * config/tc-s390.c, * config/tc-score.c,
* config/tc-score.h, * config/tc-score7.c, * config/tc-sh.c,
* config/tc-sh.h, * config/tc-spu.c, * config/tc-tic54x.c,
* config/tc-tic6x.c, * config/tc-tic6x.h, * config/tc-tilegx.c,
* config/tc-tilepro.c, * config/tc-v850.c, * config/tc-v850.h,
* config/tc-visium.c, * config/tc-visium.h, * config/tc-wasm32.c,
* config/tc-wasm32.h, * config/tc-xc16x.c, * config/tc-xgate.c,
* config/tc-xstormy16.c, * config/tc-xstormy16.h,
* config/tc-xtensa.c, * config/tc-xtensa.h, * config/tc-z80.c,
* config/tc-z8k.c, * config/xtensa-istack.h,
* config/xtensa-relax.c, * config/xtensa-relax.h, * dw2gencfi.c,
* dwarf2dbg.c, * dwarf2dbg.h, * expr.c, * expr.h, * frags.c,
* frags.h, * listing.c, * macro.c, * output-file.c, * read.c,
* read.h, * stabs.c, * symbols.c, * write.c: Replace bfd_boolean
with bool, FALSE with false, and TRUE with true.
2021-03-31 08:12:05 +08:00
|
|
|
|
operand->additional = true;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
operand->code |= 060;
|
|
|
|
|
switch (operand->reloc.exp.X_op)
|
|
|
|
|
{
|
|
|
|
|
case O_symbol:
|
2009-02-03 18:58:46 +08:00
|
|
|
|
operand->reloc.type = BFD_RELOC_16;
|
|
|
|
|
operand->reloc.pc_rel = 0;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
case O_constant:
|
|
|
|
|
if ((operand->code & 7) == 7)
|
|
|
|
|
{
|
|
|
|
|
operand->reloc.pc_rel = 1;
|
|
|
|
|
operand->word = operand->reloc.exp.X_add_number;
|
|
|
|
|
}
|
|
|
|
|
else
|
2005-03-23 19:18:14 +08:00
|
|
|
|
operand->word = operand->reloc.exp.X_add_number;
|
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
BAD_CASE (operand->reloc.exp.X_op);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *
|
2002-03-05 11:10:34 +08:00
|
|
|
|
parse_op_noreg (char *str, struct pdp11_code *operand)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
operand->error = NULL;
|
|
|
|
|
|
|
|
|
|
if (*str == '@' || *str == '*')
|
|
|
|
|
{
|
2018-08-01 22:14:46 +08:00
|
|
|
|
/* @(Rn) == @0(Rn): Mode 7, Indexed deferred.
|
|
|
|
|
Check for auto-increment deferred. */
|
|
|
|
|
if (str[1] == '('
|
|
|
|
|
&& str[2] != 0
|
|
|
|
|
&& str[3] != 0
|
|
|
|
|
&& str[4] != 0
|
|
|
|
|
&& str[5] != '+')
|
|
|
|
|
{
|
|
|
|
|
/* Change implied to explicit index deferred. */
|
|
|
|
|
*str = '0';
|
|
|
|
|
str = parse_op_no_deferred (str, operand);
|
|
|
|
|
}
|
|
|
|
|
else
|
2018-08-07 15:34:08 +08:00
|
|
|
|
{
|
|
|
|
|
/* @Rn == (Rn): Register deferred. */
|
|
|
|
|
str = parse_reg (str + 1, operand);
|
|
|
|
|
|
|
|
|
|
/* Not @Rn */
|
|
|
|
|
if (operand->error)
|
|
|
|
|
{
|
|
|
|
|
operand->error = NULL;
|
|
|
|
|
str = parse_op_no_deferred (str, operand);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-08-01 22:14:46 +08:00
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
if (operand->error)
|
|
|
|
|
return str;
|
2018-08-07 15:34:08 +08:00
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
operand->code |= 010;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
str = parse_op_no_deferred (str, operand);
|
|
|
|
|
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-05 11:10:34 +08:00
|
|
|
|
static char *
|
|
|
|
|
parse_op (char *str, struct pdp11_code *operand)
|
|
|
|
|
{
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
|
|
|
|
|
str = parse_reg (str, operand);
|
|
|
|
|
if (!operand->error)
|
|
|
|
|
return str;
|
|
|
|
|
|
|
|
|
|
operand->error = NULL;
|
|
|
|
|
parse_ac5 (str, operand);
|
|
|
|
|
if (!operand->error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("Float AC not legal as integer operand");
|
2002-03-05 11:10:34 +08:00
|
|
|
|
return str;
|
|
|
|
|
}
|
2002-05-11 17:53:52 +08:00
|
|
|
|
|
2002-03-05 11:10:34 +08:00
|
|
|
|
return parse_op_noreg (str, operand);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
|
parse_fop (char *str, struct pdp11_code *operand)
|
|
|
|
|
{
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
|
|
|
|
|
str = parse_ac5 (str, operand);
|
|
|
|
|
if (!operand->error)
|
|
|
|
|
return str;
|
|
|
|
|
|
|
|
|
|
operand->error = NULL;
|
|
|
|
|
parse_reg (str, operand);
|
|
|
|
|
if (!operand->error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
operand->error = _("General register not legal as float operand");
|
2002-03-05 11:10:34 +08:00
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return parse_op_noreg (str, operand);
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
static char *
|
|
|
|
|
parse_separator (char *str, int *error)
|
|
|
|
|
{
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
*error = (*str != ',');
|
|
|
|
|
if (!*error)
|
|
|
|
|
str++;
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_assemble (char *instruction_string)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
2002-06-08 15:37:16 +08:00
|
|
|
|
const struct pdp11_opcode *op;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
struct pdp11_code insn, op1, op2;
|
|
|
|
|
int error;
|
|
|
|
|
int size;
|
2016-04-01 20:07:50 +08:00
|
|
|
|
const char *err = NULL;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
char *str;
|
|
|
|
|
char *p;
|
|
|
|
|
char c;
|
|
|
|
|
|
|
|
|
|
str = skip_whitespace (instruction_string);
|
|
|
|
|
p = find_whitespace (str);
|
|
|
|
|
if (p - str == 0)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
as_bad (_("No instruction found"));
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
c = *p;
|
|
|
|
|
*p = '\0';
|
2020-08-18 16:57:21 +08:00
|
|
|
|
op = (struct pdp11_opcode *)str_hash_find (insn_hash, str);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
*p = c;
|
|
|
|
|
if (op == 0)
|
|
|
|
|
{
|
2002-03-05 11:10:34 +08:00
|
|
|
|
as_bad (_("Unknown instruction '%s'"), str);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!pdp11_extension[op->extension])
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
as_warn (_("Unsupported instruction set extension: %s"), op->name);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
insn.error = NULL;
|
|
|
|
|
insn.code = op->opcode;
|
|
|
|
|
insn.reloc.type = BFD_RELOC_NONE;
|
|
|
|
|
op1.error = NULL;
|
Use bool in gas
* as.h (POISON_BFD_BOOLEAN): Define.
* as.c, * as.h, * atof-generic.c, * config/atof-ieee.c,
* config/bfin-aux.h, * config/obj-coff.c, * config/obj-ecoff.c,
* config/obj-elf.c, * config/obj-elf.h, * config/obj-som.c,
* config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
* config/tc-arc.h, * config/tc-arm.c, * config/tc-arm.h,
* config/tc-avr.c, * config/tc-avr.h, * config/tc-bfin.c,
* config/tc-bfin.h, * config/tc-bpf.c, * config/tc-cris.c,
* config/tc-csky.c, * config/tc-csky.h, * config/tc-d10v.c,
* config/tc-d10v.h, * config/tc-d30v.c, * config/tc-d30v.h,
* config/tc-dlx.c, * config/tc-dlx.h, * config/tc-epiphany.c,
* config/tc-epiphany.h, * config/tc-fr30.c, * config/tc-fr30.h,
* config/tc-frv.c, * config/tc-frv.h, * config/tc-ft32.c,
* config/tc-ft32.h, * config/tc-h8300.c, * config/tc-hppa.c,
* config/tc-i386-intel.c, * config/tc-i386.c, * config/tc-ia64.c,
* config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-iq2000.h,
* config/tc-lm32.c, * config/tc-lm32.h, * config/tc-m32c.c,
* config/tc-m32c.h, * config/tc-m32r.c, * config/tc-m32r.h,
* config/tc-m68hc11.c, * config/tc-m68k.c, * config/tc-mcore.c,
* config/tc-mcore.h, * config/tc-mep.c, * config/tc-mep.h,
* config/tc-metag.c, * config/tc-metag.h,
* config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mips.h,
* config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c,
* config/tc-mn10300.h, * config/tc-moxie.c, * config/tc-msp430.c,
* config/tc-msp430.h, * config/tc-mt.c, * config/tc-mt.h,
* config/tc-nds32.c, * config/tc-nds32.h, * config/tc-nios2.c,
* config/tc-ns32k.c, * config/tc-or1k.c, * config/tc-or1k.h,
* config/tc-pdp11.c, * config/tc-ppc.c, * config/tc-pru.c,
* config/tc-pru.h, * config/tc-riscv.c, * config/tc-riscv.h,
* config/tc-rx.c, * config/tc-rx.h, * config/tc-s12z.c,
* config/tc-s12z.h, * config/tc-s390.c, * config/tc-score.c,
* config/tc-score.h, * config/tc-score7.c, * config/tc-sh.c,
* config/tc-sh.h, * config/tc-spu.c, * config/tc-tic54x.c,
* config/tc-tic6x.c, * config/tc-tic6x.h, * config/tc-tilegx.c,
* config/tc-tilepro.c, * config/tc-v850.c, * config/tc-v850.h,
* config/tc-visium.c, * config/tc-visium.h, * config/tc-wasm32.c,
* config/tc-wasm32.h, * config/tc-xc16x.c, * config/tc-xgate.c,
* config/tc-xstormy16.c, * config/tc-xstormy16.h,
* config/tc-xtensa.c, * config/tc-xtensa.h, * config/tc-z80.c,
* config/tc-z8k.c, * config/xtensa-istack.h,
* config/xtensa-relax.c, * config/xtensa-relax.h, * dw2gencfi.c,
* dwarf2dbg.c, * dwarf2dbg.h, * expr.c, * expr.h, * frags.c,
* frags.h, * listing.c, * macro.c, * output-file.c, * read.c,
* read.h, * stabs.c, * symbols.c, * write.c: Replace bfd_boolean
with bool, FALSE with false, and TRUE with true.
2021-03-31 08:12:05 +08:00
|
|
|
|
op1.additional = false;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
op1.reloc.type = BFD_RELOC_NONE;
|
|
|
|
|
op2.error = NULL;
|
Use bool in gas
* as.h (POISON_BFD_BOOLEAN): Define.
* as.c, * as.h, * atof-generic.c, * config/atof-ieee.c,
* config/bfin-aux.h, * config/obj-coff.c, * config/obj-ecoff.c,
* config/obj-elf.c, * config/obj-elf.h, * config/obj-som.c,
* config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
* config/tc-arc.h, * config/tc-arm.c, * config/tc-arm.h,
* config/tc-avr.c, * config/tc-avr.h, * config/tc-bfin.c,
* config/tc-bfin.h, * config/tc-bpf.c, * config/tc-cris.c,
* config/tc-csky.c, * config/tc-csky.h, * config/tc-d10v.c,
* config/tc-d10v.h, * config/tc-d30v.c, * config/tc-d30v.h,
* config/tc-dlx.c, * config/tc-dlx.h, * config/tc-epiphany.c,
* config/tc-epiphany.h, * config/tc-fr30.c, * config/tc-fr30.h,
* config/tc-frv.c, * config/tc-frv.h, * config/tc-ft32.c,
* config/tc-ft32.h, * config/tc-h8300.c, * config/tc-hppa.c,
* config/tc-i386-intel.c, * config/tc-i386.c, * config/tc-ia64.c,
* config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-iq2000.h,
* config/tc-lm32.c, * config/tc-lm32.h, * config/tc-m32c.c,
* config/tc-m32c.h, * config/tc-m32r.c, * config/tc-m32r.h,
* config/tc-m68hc11.c, * config/tc-m68k.c, * config/tc-mcore.c,
* config/tc-mcore.h, * config/tc-mep.c, * config/tc-mep.h,
* config/tc-metag.c, * config/tc-metag.h,
* config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mips.h,
* config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c,
* config/tc-mn10300.h, * config/tc-moxie.c, * config/tc-msp430.c,
* config/tc-msp430.h, * config/tc-mt.c, * config/tc-mt.h,
* config/tc-nds32.c, * config/tc-nds32.h, * config/tc-nios2.c,
* config/tc-ns32k.c, * config/tc-or1k.c, * config/tc-or1k.h,
* config/tc-pdp11.c, * config/tc-ppc.c, * config/tc-pru.c,
* config/tc-pru.h, * config/tc-riscv.c, * config/tc-riscv.h,
* config/tc-rx.c, * config/tc-rx.h, * config/tc-s12z.c,
* config/tc-s12z.h, * config/tc-s390.c, * config/tc-score.c,
* config/tc-score.h, * config/tc-score7.c, * config/tc-sh.c,
* config/tc-sh.h, * config/tc-spu.c, * config/tc-tic54x.c,
* config/tc-tic6x.c, * config/tc-tic6x.h, * config/tc-tilegx.c,
* config/tc-tilepro.c, * config/tc-v850.c, * config/tc-v850.h,
* config/tc-visium.c, * config/tc-visium.h, * config/tc-wasm32.c,
* config/tc-wasm32.h, * config/tc-xc16x.c, * config/tc-xgate.c,
* config/tc-xstormy16.c, * config/tc-xstormy16.h,
* config/tc-xtensa.c, * config/tc-xtensa.h, * config/tc-z80.c,
* config/tc-z8k.c, * config/xtensa-istack.h,
* config/xtensa-relax.c, * config/xtensa-relax.h, * dw2gencfi.c,
* dwarf2dbg.c, * dwarf2dbg.h, * expr.c, * expr.h, * frags.c,
* frags.h, * listing.c, * macro.c, * output-file.c, * read.c,
* read.h, * stabs.c, * symbols.c, * write.c: Replace bfd_boolean
with bool, FALSE with false, and TRUE with true.
2021-03-31 08:12:05 +08:00
|
|
|
|
op2.additional = false;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
op2.reloc.type = BFD_RELOC_NONE;
|
|
|
|
|
|
|
|
|
|
str = p;
|
|
|
|
|
size = 2;
|
|
|
|
|
|
|
|
|
|
switch (op->type)
|
|
|
|
|
{
|
|
|
|
|
case PDP11_OPCODE_NO_OPS:
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PDP11_OPCODE_IMM3:
|
|
|
|
|
case PDP11_OPCODE_IMM6:
|
|
|
|
|
case PDP11_OPCODE_IMM8:
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
if (*str == '#' || *str == '$')
|
|
|
|
|
str++;
|
|
|
|
|
str = parse_expression (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
2002-03-05 11:10:34 +08:00
|
|
|
|
if (op1.reloc.exp.X_op != O_constant || op1.reloc.type != BFD_RELOC_NONE)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("operand is not an absolute constant");
|
2002-03-05 11:10:34 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
2001-02-19 07:33:11 +08:00
|
|
|
|
switch (op->type)
|
|
|
|
|
{
|
|
|
|
|
case PDP11_OPCODE_IMM3:
|
2002-03-05 11:10:34 +08:00
|
|
|
|
if (op1.reloc.exp.X_add_number & ~7)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("3-bit immediate out of range");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case PDP11_OPCODE_IMM6:
|
2002-03-05 11:10:34 +08:00
|
|
|
|
if (op1.reloc.exp.X_add_number & ~0x3f)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("6-bit immediate out of range");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case PDP11_OPCODE_IMM8:
|
2002-03-05 11:10:34 +08:00
|
|
|
|
if (op1.reloc.exp.X_add_number & ~0xff)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("8-bit immediate out of range");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2002-03-05 11:10:34 +08:00
|
|
|
|
insn.code |= op1.reloc.exp.X_add_number;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PDP11_OPCODE_DISPL:
|
|
|
|
|
{
|
Updated sources to avoid using the identifier name "new", which is a
keyword in c++.
* bfd/aoutx.h (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol.
* bfd/coffgen.c (coff_make_empty_symbol)
(coff_bfd_make_debug_symbol): Rename variable new to new_symbol.
* bfd/cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable
new to new_insn.
* bfd/doc/chew.c (newentry, add_intrinsic): Rename variable new to
new_d.
* bfd/ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument
new to new_reloc.
* bfd/hash.c (bfd_hash_lookup): Rename variable new to new_string.
* bfd/ieee.c (ieee_make_empty_symbol): Rename variable new to
new_symbol.
* bfd/linker.c (bfd_new_link_order): Rename variable new to
new_lo.
* bfd/mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to
symbol.
* bfd/oasys.c (oasys_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/pdp11.c (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol_type.
* bfd/plugin.c (bfd_plugin_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/rs6000-core.c (CoreHdr, VmInfo): Rename union member new to
new_dump.
(read_hdr, rs6000coff_core_p)
(rs6000coff_core_file_matches_executable_p)
(rs6000coff_core_file_failing_command)
(rs6000coff_core_file_failing_signal): Updated function to use new
union member name.
* bfd/som.c (som_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/syms.c (_bfd_generic_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/tekhex.c (first_phase, tekhex_make_empty_symbol): Rename
variable new to new_symbol.
* binutils/nlmconv.c (main): Rename variable new to new_name.
* gas/config/tc-arm.c (insert_reg_alias): Rename variable new to
new_reg.
* gas/config/tc-dlx.c (parse_operand): Rename variable new to
new_pos.
* gas/config/tc-ia64.c (ia64_gen_real_reloc_type): Rename variable
new to newr.
* gas/config/tc-mcore.c (parse_exp, parse_imm): Rename variable
new to new_pointer.
* gas/config/tc-microblaze.c (parse_exp, parse_imm, check_got):
Change name from new to new_pointer.
* gas/config/tc-or32.c (parse_operand): Rename variable new to
new_pointer.
* gas/config/tc-pdp11.c (md_assemble): Rename variable new to
new_pointer.
* gas/config/tc-pj.c (alias): Change argument new to new_name.
* gas/config/tc-score.c (s3_build_score_ops_hsh): Rename variable
new to new_opcode. (s3_build_dependency_insn_hsh) Rename variable
new to new_i2n. (s3_convert): Rename variables old and new to
r_old and r_new.
* gas/config/tc-score7.c (s7_build_score_ops_hsh): Rename variable
new to new_opcode. (s7_build_dependency_insn_hsh): Rename variable
new to new_i2d. (s7_b32_relax_to_b16, s7_convert_frag): Rename
variables old and new to r_old and r_new.
* gas/config/tc-sh.c (parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-sh64.c (shmedia_parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-tic4x.c (tic4x_operand_parse): Rename variable new
to new_pointer.
* gas/config/tc-z8k.c (parse_exp): Rename variable new to
new_pointer.
* gas/listing.c (listing_newline): Rename variable new to new_i.
* ld/ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop)
(exp_trinop, exp_unop, exp_nameop, exp_assop): Rename variable new
to new_e.
* ld/ldfile.c (ldfile_add_library_path): Rename variable new to
new_dirs. (ldfile_add_arch): Rename variable new to new_arch.
* ld/ldlang.c (new_statement, lang_final, lang_add_wild)
(lang_target, lang_add_fill, lang_add_data, lang_add_assignment)
(lang_add_insert): Rename variable new to new_stmt. (new_afile):
Added missing cast. (lang_memory_region_lookup): Rename variable
new to new_region. (init_os): Rename variable new to
new_userdata. (lang_add_section): Rename variable new to
new_section. (ldlang_add_undef): Rename variable new to
new_undef. (realsymbol): Rename variable new to new_name.
* opcodes/z8kgen.c (internal, gas): Rename variable new to new_op.
Updated sources to avoid using the identifier name "template",
which is a keyword in c++.
* bfd/elf32-arm.c (struct stub_def): Rename member template to
template_sequence. (arm_build_one_stub,
find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub):
Rename variable template to template_sequence.
* bfd/elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl):
Rename variable template to template_val.
* gas/config/tc-arm.c (struct asm_cond, struct asm_psr, struct
asm_barrier_opt): Change member template to
template_name. (md_begin): Update code to reflect new member
names.
* gas/config/tc-i386.c (struct templates, struct _i386_insn)
(match_template, cpu_flags_match, match_reg_size, match_mem_size)
(operand_size_match, md_begin, i386_print_statistics, pi)
(build_vex_prefix, md_assemble, parse_insn, optimize_imm)
(optimize_disp): Updated code to use new names. (parse_insn):
Added casts.
* gas/config/tc-ia64.c (dot_template, emit_one_bundle): Updated
code to use new names.
* gas/config/tc-score.c (struct s3_asm_opcode): Renamed member
template to template_name. (s3_parse_16_32_inst, s3_parse_48_inst,
s3_do_macro_ldst_label, s3_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-score7.c (struct s7_asm_opcode): Renamed member
template to template_name. (s7_parse_16_32_inst,
s7_do_macro_ldst_label, s7_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-tic30.c (md_begin, struct tic30_insn)
(md_assemble): Update code to use new names.
* gas/config/tc-tic54x.c (struct _tic54x_insn, md_begin)
(optimize_insn, tic54x_parse_insn, next_line_shows_parallel):
Update code to use new names.
* include/opcode/tic30.h (template): Rename type template to
insn_template. Updated code to use new name.
* include/opcode/tic54x.h (template): Rename type template to
insn_template.
* opcodes/cris-dis.c (bytes_to_skip): Update code to use new name.
* opcodes/i386-dis.c (putop): Update code to use new name.
* opcodes/i386-gen.c (process_i386_opcodes): Update code to use
new name.
* opcodes/i386-opc.h (struct template): Rename struct template to
insn_template. Update code accordingly.
* opcodes/i386-tbl.h (i386_optab): Update type to use new name.
* opcodes/ia64-dis.c (print_insn_ia64): Rename variable template
to template_val.
* opcodes/tic30-dis.c (struct instruction, get_tic30_instruction):
Update code to use new name.
* opcodes/tic54x-dis.c (has_lkaddr, get_insn_size)
(print_parallel_instruction, print_insn_tic54x, tic54x_get_insn):
Update code to use new name.
* opcodes/tic54x-opc.c (tic54x_unknown_opcode, tic54x_optab):
Update type to new name.
2009-08-30 06:11:02 +08:00
|
|
|
|
char *new_pointer;
|
|
|
|
|
new_pointer = parse_expression (str, &op1);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
op1.code = 0;
|
|
|
|
|
op1.reloc.pc_rel = 1;
|
|
|
|
|
op1.reloc.type = BFD_RELOC_PDP11_DISP_8_PCREL;
|
|
|
|
|
if (op1.reloc.exp.X_op != O_symbol)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("Symbol expected");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (op1.code & ~0xff)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
err = _("8-bit displacement out of range");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
Updated sources to avoid using the identifier name "new", which is a
keyword in c++.
* bfd/aoutx.h (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol.
* bfd/coffgen.c (coff_make_empty_symbol)
(coff_bfd_make_debug_symbol): Rename variable new to new_symbol.
* bfd/cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable
new to new_insn.
* bfd/doc/chew.c (newentry, add_intrinsic): Rename variable new to
new_d.
* bfd/ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument
new to new_reloc.
* bfd/hash.c (bfd_hash_lookup): Rename variable new to new_string.
* bfd/ieee.c (ieee_make_empty_symbol): Rename variable new to
new_symbol.
* bfd/linker.c (bfd_new_link_order): Rename variable new to
new_lo.
* bfd/mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to
symbol.
* bfd/oasys.c (oasys_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/pdp11.c (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol_type.
* bfd/plugin.c (bfd_plugin_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/rs6000-core.c (CoreHdr, VmInfo): Rename union member new to
new_dump.
(read_hdr, rs6000coff_core_p)
(rs6000coff_core_file_matches_executable_p)
(rs6000coff_core_file_failing_command)
(rs6000coff_core_file_failing_signal): Updated function to use new
union member name.
* bfd/som.c (som_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/syms.c (_bfd_generic_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/tekhex.c (first_phase, tekhex_make_empty_symbol): Rename
variable new to new_symbol.
* binutils/nlmconv.c (main): Rename variable new to new_name.
* gas/config/tc-arm.c (insert_reg_alias): Rename variable new to
new_reg.
* gas/config/tc-dlx.c (parse_operand): Rename variable new to
new_pos.
* gas/config/tc-ia64.c (ia64_gen_real_reloc_type): Rename variable
new to newr.
* gas/config/tc-mcore.c (parse_exp, parse_imm): Rename variable
new to new_pointer.
* gas/config/tc-microblaze.c (parse_exp, parse_imm, check_got):
Change name from new to new_pointer.
* gas/config/tc-or32.c (parse_operand): Rename variable new to
new_pointer.
* gas/config/tc-pdp11.c (md_assemble): Rename variable new to
new_pointer.
* gas/config/tc-pj.c (alias): Change argument new to new_name.
* gas/config/tc-score.c (s3_build_score_ops_hsh): Rename variable
new to new_opcode. (s3_build_dependency_insn_hsh) Rename variable
new to new_i2n. (s3_convert): Rename variables old and new to
r_old and r_new.
* gas/config/tc-score7.c (s7_build_score_ops_hsh): Rename variable
new to new_opcode. (s7_build_dependency_insn_hsh): Rename variable
new to new_i2d. (s7_b32_relax_to_b16, s7_convert_frag): Rename
variables old and new to r_old and r_new.
* gas/config/tc-sh.c (parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-sh64.c (shmedia_parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-tic4x.c (tic4x_operand_parse): Rename variable new
to new_pointer.
* gas/config/tc-z8k.c (parse_exp): Rename variable new to
new_pointer.
* gas/listing.c (listing_newline): Rename variable new to new_i.
* ld/ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop)
(exp_trinop, exp_unop, exp_nameop, exp_assop): Rename variable new
to new_e.
* ld/ldfile.c (ldfile_add_library_path): Rename variable new to
new_dirs. (ldfile_add_arch): Rename variable new to new_arch.
* ld/ldlang.c (new_statement, lang_final, lang_add_wild)
(lang_target, lang_add_fill, lang_add_data, lang_add_assignment)
(lang_add_insert): Rename variable new to new_stmt. (new_afile):
Added missing cast. (lang_memory_region_lookup): Rename variable
new to new_region. (init_os): Rename variable new to
new_userdata. (lang_add_section): Rename variable new to
new_section. (ldlang_add_undef): Rename variable new to
new_undef. (realsymbol): Rename variable new to new_name.
* opcodes/z8kgen.c (internal, gas): Rename variable new to new_op.
Updated sources to avoid using the identifier name "template",
which is a keyword in c++.
* bfd/elf32-arm.c (struct stub_def): Rename member template to
template_sequence. (arm_build_one_stub,
find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub):
Rename variable template to template_sequence.
* bfd/elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl):
Rename variable template to template_val.
* gas/config/tc-arm.c (struct asm_cond, struct asm_psr, struct
asm_barrier_opt): Change member template to
template_name. (md_begin): Update code to reflect new member
names.
* gas/config/tc-i386.c (struct templates, struct _i386_insn)
(match_template, cpu_flags_match, match_reg_size, match_mem_size)
(operand_size_match, md_begin, i386_print_statistics, pi)
(build_vex_prefix, md_assemble, parse_insn, optimize_imm)
(optimize_disp): Updated code to use new names. (parse_insn):
Added casts.
* gas/config/tc-ia64.c (dot_template, emit_one_bundle): Updated
code to use new names.
* gas/config/tc-score.c (struct s3_asm_opcode): Renamed member
template to template_name. (s3_parse_16_32_inst, s3_parse_48_inst,
s3_do_macro_ldst_label, s3_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-score7.c (struct s7_asm_opcode): Renamed member
template to template_name. (s7_parse_16_32_inst,
s7_do_macro_ldst_label, s7_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-tic30.c (md_begin, struct tic30_insn)
(md_assemble): Update code to use new names.
* gas/config/tc-tic54x.c (struct _tic54x_insn, md_begin)
(optimize_insn, tic54x_parse_insn, next_line_shows_parallel):
Update code to use new names.
* include/opcode/tic30.h (template): Rename type template to
insn_template. Updated code to use new name.
* include/opcode/tic54x.h (template): Rename type template to
insn_template.
* opcodes/cris-dis.c (bytes_to_skip): Update code to use new name.
* opcodes/i386-dis.c (putop): Update code to use new name.
* opcodes/i386-gen.c (process_i386_opcodes): Update code to use
new name.
* opcodes/i386-opc.h (struct template): Rename struct template to
insn_template. Update code accordingly.
* opcodes/i386-tbl.h (i386_optab): Update type to use new name.
* opcodes/ia64-dis.c (print_insn_ia64): Rename variable template
to template_val.
* opcodes/tic30-dis.c (struct instruction, get_tic30_instruction):
Update code to use new name.
* opcodes/tic54x-dis.c (has_lkaddr, get_insn_size)
(print_parallel_instruction, print_insn_tic54x, tic54x_get_insn):
Update code to use new name.
* opcodes/tic54x-opc.c (tic54x_unknown_opcode, tic54x_optab):
Update type to new name.
2009-08-30 06:11:02 +08:00
|
|
|
|
str = new_pointer;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
insn.reloc = op1.reloc;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PDP11_OPCODE_REG:
|
|
|
|
|
str = parse_reg (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PDP11_OPCODE_OP:
|
|
|
|
|
str = parse_op (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
break;
|
|
|
|
|
|
2002-03-05 11:10:34 +08:00
|
|
|
|
case PDP11_OPCODE_FOP:
|
|
|
|
|
str = parse_fop (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
break;
|
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
case PDP11_OPCODE_REG_OP:
|
|
|
|
|
str = parse_reg (str, &op2);
|
|
|
|
|
if (op2.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op2.code << 6;
|
|
|
|
|
str = parse_separator (str, &error);
|
|
|
|
|
if (error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op2.error = _("Missing ','");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
str = parse_op (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PDP11_OPCODE_REG_OP_REV:
|
|
|
|
|
str = parse_op (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
str = parse_separator (str, &error);
|
|
|
|
|
if (error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op2.error = _("Missing ','");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
str = parse_reg (str, &op2);
|
|
|
|
|
if (op2.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op2.code << 6;
|
|
|
|
|
break;
|
|
|
|
|
|
2002-03-05 11:10:34 +08:00
|
|
|
|
case PDP11_OPCODE_AC_FOP:
|
|
|
|
|
str = parse_ac (str, &op2);
|
|
|
|
|
if (op2.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op2.code << 6;
|
|
|
|
|
str = parse_separator (str, &error);
|
|
|
|
|
if (error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("Missing ','");
|
2002-03-05 11:10:34 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
str = parse_fop (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PDP11_OPCODE_FOP_AC:
|
|
|
|
|
str = parse_fop (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
str = parse_separator (str, &error);
|
|
|
|
|
if (error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("Missing ','");
|
2002-03-05 11:10:34 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
str = parse_ac (str, &op2);
|
|
|
|
|
if (op2.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op2.code << 6;
|
|
|
|
|
break;
|
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
case PDP11_OPCODE_AC_OP:
|
|
|
|
|
str = parse_ac (str, &op2);
|
|
|
|
|
if (op2.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op2.code << 6;
|
|
|
|
|
str = parse_separator (str, &error);
|
|
|
|
|
if (error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("Missing ','");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
str = parse_op (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
break;
|
|
|
|
|
|
2002-03-05 11:10:34 +08:00
|
|
|
|
case PDP11_OPCODE_OP_AC:
|
|
|
|
|
str = parse_op (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
str = parse_separator (str, &error);
|
|
|
|
|
if (error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("Missing ','");
|
2002-03-05 11:10:34 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
str = parse_ac (str, &op2);
|
|
|
|
|
if (op2.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op2.code << 6;
|
|
|
|
|
break;
|
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
case PDP11_OPCODE_OP_OP:
|
|
|
|
|
str = parse_op (str, &op1);
|
|
|
|
|
if (op1.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op1.code << 6;
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
str = parse_separator (str, &error);
|
|
|
|
|
if (error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op2.error = _("Missing ','");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
str = parse_op (str, &op2);
|
|
|
|
|
if (op2.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op2.code;
|
|
|
|
|
if (op2.additional)
|
|
|
|
|
size += 2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PDP11_OPCODE_REG_DISPL:
|
|
|
|
|
{
|
Updated sources to avoid using the identifier name "new", which is a
keyword in c++.
* bfd/aoutx.h (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol.
* bfd/coffgen.c (coff_make_empty_symbol)
(coff_bfd_make_debug_symbol): Rename variable new to new_symbol.
* bfd/cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable
new to new_insn.
* bfd/doc/chew.c (newentry, add_intrinsic): Rename variable new to
new_d.
* bfd/ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument
new to new_reloc.
* bfd/hash.c (bfd_hash_lookup): Rename variable new to new_string.
* bfd/ieee.c (ieee_make_empty_symbol): Rename variable new to
new_symbol.
* bfd/linker.c (bfd_new_link_order): Rename variable new to
new_lo.
* bfd/mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to
symbol.
* bfd/oasys.c (oasys_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/pdp11.c (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol_type.
* bfd/plugin.c (bfd_plugin_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/rs6000-core.c (CoreHdr, VmInfo): Rename union member new to
new_dump.
(read_hdr, rs6000coff_core_p)
(rs6000coff_core_file_matches_executable_p)
(rs6000coff_core_file_failing_command)
(rs6000coff_core_file_failing_signal): Updated function to use new
union member name.
* bfd/som.c (som_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/syms.c (_bfd_generic_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/tekhex.c (first_phase, tekhex_make_empty_symbol): Rename
variable new to new_symbol.
* binutils/nlmconv.c (main): Rename variable new to new_name.
* gas/config/tc-arm.c (insert_reg_alias): Rename variable new to
new_reg.
* gas/config/tc-dlx.c (parse_operand): Rename variable new to
new_pos.
* gas/config/tc-ia64.c (ia64_gen_real_reloc_type): Rename variable
new to newr.
* gas/config/tc-mcore.c (parse_exp, parse_imm): Rename variable
new to new_pointer.
* gas/config/tc-microblaze.c (parse_exp, parse_imm, check_got):
Change name from new to new_pointer.
* gas/config/tc-or32.c (parse_operand): Rename variable new to
new_pointer.
* gas/config/tc-pdp11.c (md_assemble): Rename variable new to
new_pointer.
* gas/config/tc-pj.c (alias): Change argument new to new_name.
* gas/config/tc-score.c (s3_build_score_ops_hsh): Rename variable
new to new_opcode. (s3_build_dependency_insn_hsh) Rename variable
new to new_i2n. (s3_convert): Rename variables old and new to
r_old and r_new.
* gas/config/tc-score7.c (s7_build_score_ops_hsh): Rename variable
new to new_opcode. (s7_build_dependency_insn_hsh): Rename variable
new to new_i2d. (s7_b32_relax_to_b16, s7_convert_frag): Rename
variables old and new to r_old and r_new.
* gas/config/tc-sh.c (parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-sh64.c (shmedia_parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-tic4x.c (tic4x_operand_parse): Rename variable new
to new_pointer.
* gas/config/tc-z8k.c (parse_exp): Rename variable new to
new_pointer.
* gas/listing.c (listing_newline): Rename variable new to new_i.
* ld/ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop)
(exp_trinop, exp_unop, exp_nameop, exp_assop): Rename variable new
to new_e.
* ld/ldfile.c (ldfile_add_library_path): Rename variable new to
new_dirs. (ldfile_add_arch): Rename variable new to new_arch.
* ld/ldlang.c (new_statement, lang_final, lang_add_wild)
(lang_target, lang_add_fill, lang_add_data, lang_add_assignment)
(lang_add_insert): Rename variable new to new_stmt. (new_afile):
Added missing cast. (lang_memory_region_lookup): Rename variable
new to new_region. (init_os): Rename variable new to
new_userdata. (lang_add_section): Rename variable new to
new_section. (ldlang_add_undef): Rename variable new to
new_undef. (realsymbol): Rename variable new to new_name.
* opcodes/z8kgen.c (internal, gas): Rename variable new to new_op.
Updated sources to avoid using the identifier name "template",
which is a keyword in c++.
* bfd/elf32-arm.c (struct stub_def): Rename member template to
template_sequence. (arm_build_one_stub,
find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub):
Rename variable template to template_sequence.
* bfd/elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl):
Rename variable template to template_val.
* gas/config/tc-arm.c (struct asm_cond, struct asm_psr, struct
asm_barrier_opt): Change member template to
template_name. (md_begin): Update code to reflect new member
names.
* gas/config/tc-i386.c (struct templates, struct _i386_insn)
(match_template, cpu_flags_match, match_reg_size, match_mem_size)
(operand_size_match, md_begin, i386_print_statistics, pi)
(build_vex_prefix, md_assemble, parse_insn, optimize_imm)
(optimize_disp): Updated code to use new names. (parse_insn):
Added casts.
* gas/config/tc-ia64.c (dot_template, emit_one_bundle): Updated
code to use new names.
* gas/config/tc-score.c (struct s3_asm_opcode): Renamed member
template to template_name. (s3_parse_16_32_inst, s3_parse_48_inst,
s3_do_macro_ldst_label, s3_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-score7.c (struct s7_asm_opcode): Renamed member
template to template_name. (s7_parse_16_32_inst,
s7_do_macro_ldst_label, s7_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-tic30.c (md_begin, struct tic30_insn)
(md_assemble): Update code to use new names.
* gas/config/tc-tic54x.c (struct _tic54x_insn, md_begin)
(optimize_insn, tic54x_parse_insn, next_line_shows_parallel):
Update code to use new names.
* include/opcode/tic30.h (template): Rename type template to
insn_template. Updated code to use new name.
* include/opcode/tic54x.h (template): Rename type template to
insn_template.
* opcodes/cris-dis.c (bytes_to_skip): Update code to use new name.
* opcodes/i386-dis.c (putop): Update code to use new name.
* opcodes/i386-gen.c (process_i386_opcodes): Update code to use
new name.
* opcodes/i386-opc.h (struct template): Rename struct template to
insn_template. Update code accordingly.
* opcodes/i386-tbl.h (i386_optab): Update type to use new name.
* opcodes/ia64-dis.c (print_insn_ia64): Rename variable template
to template_val.
* opcodes/tic30-dis.c (struct instruction, get_tic30_instruction):
Update code to use new name.
* opcodes/tic54x-dis.c (has_lkaddr, get_insn_size)
(print_parallel_instruction, print_insn_tic54x, tic54x_get_insn):
Update code to use new name.
* opcodes/tic54x-opc.c (tic54x_unknown_opcode, tic54x_optab):
Update type to new name.
2009-08-30 06:11:02 +08:00
|
|
|
|
char *new_pointer;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
str = parse_reg (str, &op2);
|
|
|
|
|
if (op2.error)
|
|
|
|
|
break;
|
|
|
|
|
insn.code |= op2.code << 6;
|
|
|
|
|
str = parse_separator (str, &error);
|
|
|
|
|
if (error)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("Missing ','");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
Updated sources to avoid using the identifier name "new", which is a
keyword in c++.
* bfd/aoutx.h (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol.
* bfd/coffgen.c (coff_make_empty_symbol)
(coff_bfd_make_debug_symbol): Rename variable new to new_symbol.
* bfd/cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable
new to new_insn.
* bfd/doc/chew.c (newentry, add_intrinsic): Rename variable new to
new_d.
* bfd/ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument
new to new_reloc.
* bfd/hash.c (bfd_hash_lookup): Rename variable new to new_string.
* bfd/ieee.c (ieee_make_empty_symbol): Rename variable new to
new_symbol.
* bfd/linker.c (bfd_new_link_order): Rename variable new to
new_lo.
* bfd/mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to
symbol.
* bfd/oasys.c (oasys_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/pdp11.c (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol_type.
* bfd/plugin.c (bfd_plugin_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/rs6000-core.c (CoreHdr, VmInfo): Rename union member new to
new_dump.
(read_hdr, rs6000coff_core_p)
(rs6000coff_core_file_matches_executable_p)
(rs6000coff_core_file_failing_command)
(rs6000coff_core_file_failing_signal): Updated function to use new
union member name.
* bfd/som.c (som_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/syms.c (_bfd_generic_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/tekhex.c (first_phase, tekhex_make_empty_symbol): Rename
variable new to new_symbol.
* binutils/nlmconv.c (main): Rename variable new to new_name.
* gas/config/tc-arm.c (insert_reg_alias): Rename variable new to
new_reg.
* gas/config/tc-dlx.c (parse_operand): Rename variable new to
new_pos.
* gas/config/tc-ia64.c (ia64_gen_real_reloc_type): Rename variable
new to newr.
* gas/config/tc-mcore.c (parse_exp, parse_imm): Rename variable
new to new_pointer.
* gas/config/tc-microblaze.c (parse_exp, parse_imm, check_got):
Change name from new to new_pointer.
* gas/config/tc-or32.c (parse_operand): Rename variable new to
new_pointer.
* gas/config/tc-pdp11.c (md_assemble): Rename variable new to
new_pointer.
* gas/config/tc-pj.c (alias): Change argument new to new_name.
* gas/config/tc-score.c (s3_build_score_ops_hsh): Rename variable
new to new_opcode. (s3_build_dependency_insn_hsh) Rename variable
new to new_i2n. (s3_convert): Rename variables old and new to
r_old and r_new.
* gas/config/tc-score7.c (s7_build_score_ops_hsh): Rename variable
new to new_opcode. (s7_build_dependency_insn_hsh): Rename variable
new to new_i2d. (s7_b32_relax_to_b16, s7_convert_frag): Rename
variables old and new to r_old and r_new.
* gas/config/tc-sh.c (parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-sh64.c (shmedia_parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-tic4x.c (tic4x_operand_parse): Rename variable new
to new_pointer.
* gas/config/tc-z8k.c (parse_exp): Rename variable new to
new_pointer.
* gas/listing.c (listing_newline): Rename variable new to new_i.
* ld/ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop)
(exp_trinop, exp_unop, exp_nameop, exp_assop): Rename variable new
to new_e.
* ld/ldfile.c (ldfile_add_library_path): Rename variable new to
new_dirs. (ldfile_add_arch): Rename variable new to new_arch.
* ld/ldlang.c (new_statement, lang_final, lang_add_wild)
(lang_target, lang_add_fill, lang_add_data, lang_add_assignment)
(lang_add_insert): Rename variable new to new_stmt. (new_afile):
Added missing cast. (lang_memory_region_lookup): Rename variable
new to new_region. (init_os): Rename variable new to
new_userdata. (lang_add_section): Rename variable new to
new_section. (ldlang_add_undef): Rename variable new to
new_undef. (realsymbol): Rename variable new to new_name.
* opcodes/z8kgen.c (internal, gas): Rename variable new to new_op.
Updated sources to avoid using the identifier name "template",
which is a keyword in c++.
* bfd/elf32-arm.c (struct stub_def): Rename member template to
template_sequence. (arm_build_one_stub,
find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub):
Rename variable template to template_sequence.
* bfd/elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl):
Rename variable template to template_val.
* gas/config/tc-arm.c (struct asm_cond, struct asm_psr, struct
asm_barrier_opt): Change member template to
template_name. (md_begin): Update code to reflect new member
names.
* gas/config/tc-i386.c (struct templates, struct _i386_insn)
(match_template, cpu_flags_match, match_reg_size, match_mem_size)
(operand_size_match, md_begin, i386_print_statistics, pi)
(build_vex_prefix, md_assemble, parse_insn, optimize_imm)
(optimize_disp): Updated code to use new names. (parse_insn):
Added casts.
* gas/config/tc-ia64.c (dot_template, emit_one_bundle): Updated
code to use new names.
* gas/config/tc-score.c (struct s3_asm_opcode): Renamed member
template to template_name. (s3_parse_16_32_inst, s3_parse_48_inst,
s3_do_macro_ldst_label, s3_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-score7.c (struct s7_asm_opcode): Renamed member
template to template_name. (s7_parse_16_32_inst,
s7_do_macro_ldst_label, s7_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-tic30.c (md_begin, struct tic30_insn)
(md_assemble): Update code to use new names.
* gas/config/tc-tic54x.c (struct _tic54x_insn, md_begin)
(optimize_insn, tic54x_parse_insn, next_line_shows_parallel):
Update code to use new names.
* include/opcode/tic30.h (template): Rename type template to
insn_template. Updated code to use new name.
* include/opcode/tic54x.h (template): Rename type template to
insn_template.
* opcodes/cris-dis.c (bytes_to_skip): Update code to use new name.
* opcodes/i386-dis.c (putop): Update code to use new name.
* opcodes/i386-gen.c (process_i386_opcodes): Update code to use
new name.
* opcodes/i386-opc.h (struct template): Rename struct template to
insn_template. Update code accordingly.
* opcodes/i386-tbl.h (i386_optab): Update type to use new name.
* opcodes/ia64-dis.c (print_insn_ia64): Rename variable template
to template_val.
* opcodes/tic30-dis.c (struct instruction, get_tic30_instruction):
Update code to use new name.
* opcodes/tic54x-dis.c (has_lkaddr, get_insn_size)
(print_parallel_instruction, print_insn_tic54x, tic54x_get_insn):
Update code to use new name.
* opcodes/tic54x-opc.c (tic54x_unknown_opcode, tic54x_optab):
Update type to new name.
2009-08-30 06:11:02 +08:00
|
|
|
|
new_pointer = parse_expression (str, &op1);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
op1.code = 0;
|
|
|
|
|
op1.reloc.pc_rel = 1;
|
|
|
|
|
op1.reloc.type = BFD_RELOC_PDP11_DISP_6_PCREL;
|
|
|
|
|
if (op1.reloc.exp.X_op != O_symbol)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
op1.error = _("Symbol expected");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (op1.code & ~0x3f)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
err = _("6-bit displacement out of range");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
Updated sources to avoid using the identifier name "new", which is a
keyword in c++.
* bfd/aoutx.h (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol.
* bfd/coffgen.c (coff_make_empty_symbol)
(coff_bfd_make_debug_symbol): Rename variable new to new_symbol.
* bfd/cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable
new to new_insn.
* bfd/doc/chew.c (newentry, add_intrinsic): Rename variable new to
new_d.
* bfd/ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument
new to new_reloc.
* bfd/hash.c (bfd_hash_lookup): Rename variable new to new_string.
* bfd/ieee.c (ieee_make_empty_symbol): Rename variable new to
new_symbol.
* bfd/linker.c (bfd_new_link_order): Rename variable new to
new_lo.
* bfd/mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to
symbol.
* bfd/oasys.c (oasys_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/pdp11.c (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol_type.
* bfd/plugin.c (bfd_plugin_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/rs6000-core.c (CoreHdr, VmInfo): Rename union member new to
new_dump.
(read_hdr, rs6000coff_core_p)
(rs6000coff_core_file_matches_executable_p)
(rs6000coff_core_file_failing_command)
(rs6000coff_core_file_failing_signal): Updated function to use new
union member name.
* bfd/som.c (som_make_empty_symbol): Rename variable new to
new_symbol_type.
* bfd/syms.c (_bfd_generic_make_empty_symbol): Rename variable new
to new_symbol.
* bfd/tekhex.c (first_phase, tekhex_make_empty_symbol): Rename
variable new to new_symbol.
* binutils/nlmconv.c (main): Rename variable new to new_name.
* gas/config/tc-arm.c (insert_reg_alias): Rename variable new to
new_reg.
* gas/config/tc-dlx.c (parse_operand): Rename variable new to
new_pos.
* gas/config/tc-ia64.c (ia64_gen_real_reloc_type): Rename variable
new to newr.
* gas/config/tc-mcore.c (parse_exp, parse_imm): Rename variable
new to new_pointer.
* gas/config/tc-microblaze.c (parse_exp, parse_imm, check_got):
Change name from new to new_pointer.
* gas/config/tc-or32.c (parse_operand): Rename variable new to
new_pointer.
* gas/config/tc-pdp11.c (md_assemble): Rename variable new to
new_pointer.
* gas/config/tc-pj.c (alias): Change argument new to new_name.
* gas/config/tc-score.c (s3_build_score_ops_hsh): Rename variable
new to new_opcode. (s3_build_dependency_insn_hsh) Rename variable
new to new_i2n. (s3_convert): Rename variables old and new to
r_old and r_new.
* gas/config/tc-score7.c (s7_build_score_ops_hsh): Rename variable
new to new_opcode. (s7_build_dependency_insn_hsh): Rename variable
new to new_i2d. (s7_b32_relax_to_b16, s7_convert_frag): Rename
variables old and new to r_old and r_new.
* gas/config/tc-sh.c (parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-sh64.c (shmedia_parse_exp): Rename variable new to
new_pointer.
* gas/config/tc-tic4x.c (tic4x_operand_parse): Rename variable new
to new_pointer.
* gas/config/tc-z8k.c (parse_exp): Rename variable new to
new_pointer.
* gas/listing.c (listing_newline): Rename variable new to new_i.
* ld/ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop)
(exp_trinop, exp_unop, exp_nameop, exp_assop): Rename variable new
to new_e.
* ld/ldfile.c (ldfile_add_library_path): Rename variable new to
new_dirs. (ldfile_add_arch): Rename variable new to new_arch.
* ld/ldlang.c (new_statement, lang_final, lang_add_wild)
(lang_target, lang_add_fill, lang_add_data, lang_add_assignment)
(lang_add_insert): Rename variable new to new_stmt. (new_afile):
Added missing cast. (lang_memory_region_lookup): Rename variable
new to new_region. (init_os): Rename variable new to
new_userdata. (lang_add_section): Rename variable new to
new_section. (ldlang_add_undef): Rename variable new to
new_undef. (realsymbol): Rename variable new to new_name.
* opcodes/z8kgen.c (internal, gas): Rename variable new to new_op.
Updated sources to avoid using the identifier name "template",
which is a keyword in c++.
* bfd/elf32-arm.c (struct stub_def): Rename member template to
template_sequence. (arm_build_one_stub,
find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub):
Rename variable template to template_sequence.
* bfd/elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl):
Rename variable template to template_val.
* gas/config/tc-arm.c (struct asm_cond, struct asm_psr, struct
asm_barrier_opt): Change member template to
template_name. (md_begin): Update code to reflect new member
names.
* gas/config/tc-i386.c (struct templates, struct _i386_insn)
(match_template, cpu_flags_match, match_reg_size, match_mem_size)
(operand_size_match, md_begin, i386_print_statistics, pi)
(build_vex_prefix, md_assemble, parse_insn, optimize_imm)
(optimize_disp): Updated code to use new names. (parse_insn):
Added casts.
* gas/config/tc-ia64.c (dot_template, emit_one_bundle): Updated
code to use new names.
* gas/config/tc-score.c (struct s3_asm_opcode): Renamed member
template to template_name. (s3_parse_16_32_inst, s3_parse_48_inst,
s3_do_macro_ldst_label, s3_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-score7.c (struct s7_asm_opcode): Renamed member
template to template_name. (s7_parse_16_32_inst,
s7_do_macro_ldst_label, s7_build_score_ops_hsh): Update code to
use new names.
* gas/config/tc-tic30.c (md_begin, struct tic30_insn)
(md_assemble): Update code to use new names.
* gas/config/tc-tic54x.c (struct _tic54x_insn, md_begin)
(optimize_insn, tic54x_parse_insn, next_line_shows_parallel):
Update code to use new names.
* include/opcode/tic30.h (template): Rename type template to
insn_template. Updated code to use new name.
* include/opcode/tic54x.h (template): Rename type template to
insn_template.
* opcodes/cris-dis.c (bytes_to_skip): Update code to use new name.
* opcodes/i386-dis.c (putop): Update code to use new name.
* opcodes/i386-gen.c (process_i386_opcodes): Update code to use
new name.
* opcodes/i386-opc.h (struct template): Rename struct template to
insn_template. Update code accordingly.
* opcodes/i386-tbl.h (i386_optab): Update type to use new name.
* opcodes/ia64-dis.c (print_insn_ia64): Rename variable template
to template_val.
* opcodes/tic30-dis.c (struct instruction, get_tic30_instruction):
Update code to use new name.
* opcodes/tic54x-dis.c (has_lkaddr, get_insn_size)
(print_parallel_instruction, print_insn_tic54x, tic54x_get_insn):
Update code to use new name.
* opcodes/tic54x-opc.c (tic54x_unknown_opcode, tic54x_optab):
Update type to new name.
2009-08-30 06:11:02 +08:00
|
|
|
|
str = new_pointer;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
insn.code |= op1.code;
|
|
|
|
|
insn.reloc = op1.reloc;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2001-02-21 08:04:47 +08:00
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
default:
|
|
|
|
|
BAD_CASE (op->type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (op1.error)
|
|
|
|
|
err = op1.error;
|
|
|
|
|
else if (op2.error)
|
|
|
|
|
err = op2.error;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
str = skip_whitespace (str);
|
|
|
|
|
if (*str)
|
2009-07-24 19:45:01 +08:00
|
|
|
|
err = _("Too many operands");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
char *to = NULL;
|
2001-02-21 08:04:47 +08:00
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
if (err)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
as_bad ("%s", err);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
to = frag_more (size);
|
|
|
|
|
|
|
|
|
|
md_number_to_chars (to, insn.code, 2);
|
|
|
|
|
if (insn.reloc.type != BFD_RELOC_NONE)
|
|
|
|
|
fix_new_exp (frag_now, to - frag_now->fr_literal, 2,
|
|
|
|
|
&insn.reloc.exp, insn.reloc.pc_rel, insn.reloc.type);
|
|
|
|
|
to += 2;
|
|
|
|
|
|
|
|
|
|
if (op1.additional)
|
|
|
|
|
{
|
|
|
|
|
md_number_to_chars (to, op1.word, 2);
|
|
|
|
|
if (op1.reloc.type != BFD_RELOC_NONE)
|
|
|
|
|
fix_new_exp (frag_now, to - frag_now->fr_literal, 2,
|
|
|
|
|
&op1.reloc.exp, op1.reloc.pc_rel, op1.reloc.type);
|
|
|
|
|
to += 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (op2.additional)
|
|
|
|
|
{
|
|
|
|
|
md_number_to_chars (to, op2.word, 2);
|
|
|
|
|
if (op2.reloc.type != BFD_RELOC_NONE)
|
|
|
|
|
fix_new_exp (frag_now, to - frag_now->fr_literal, 2,
|
|
|
|
|
&op2.reloc.exp, op2.reloc.pc_rel, op2.reloc.type);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_estimate_size_before_relax (fragS *fragP ATTRIBUTE_UNUSED,
|
|
|
|
|
segT segment ATTRIBUTE_UNUSED)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_convert_frag (bfd *headers ATTRIBUTE_UNUSED,
|
|
|
|
|
segT seg ATTRIBUTE_UNUSED,
|
|
|
|
|
fragS *fragP ATTRIBUTE_UNUSED)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-03 09:54:25 +08:00
|
|
|
|
int md_short_jump_size = 2;
|
|
|
|
|
int md_long_jump_size = 4;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_create_short_jump (char *ptr ATTRIBUTE_UNUSED,
|
|
|
|
|
addressT from_addr ATTRIBUTE_UNUSED,
|
|
|
|
|
addressT to_addr ATTRIBUTE_UNUSED,
|
|
|
|
|
fragS *frag ATTRIBUTE_UNUSED,
|
|
|
|
|
symbolS *to_symbol ATTRIBUTE_UNUSED)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_create_long_jump (char *ptr ATTRIBUTE_UNUSED,
|
|
|
|
|
addressT from_addr ATTRIBUTE_UNUSED,
|
|
|
|
|
addressT to_addr ATTRIBUTE_UNUSED,
|
|
|
|
|
fragS *frag ATTRIBUTE_UNUSED,
|
|
|
|
|
symbolS *to_symbol ATTRIBUTE_UNUSED)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2016-02-27 22:35:32 +08:00
|
|
|
|
set_cpu_model (const char *arg)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
char buf[4];
|
|
|
|
|
char *model = buf;
|
|
|
|
|
|
|
|
|
|
if (arg[0] == 'k')
|
|
|
|
|
arg++;
|
|
|
|
|
|
|
|
|
|
*model++ = *arg++;
|
|
|
|
|
|
|
|
|
|
if (strchr ("abdx", model[-1]) == NULL)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (model[-1] == 'd')
|
|
|
|
|
{
|
2005-03-23 19:18:14 +08:00
|
|
|
|
if (arg[0] == 'f' || arg[0] == 'j')
|
2001-02-19 07:33:11 +08:00
|
|
|
|
model[-1] = *arg++;
|
|
|
|
|
}
|
|
|
|
|
else if (model[-1] == 'x')
|
|
|
|
|
{
|
|
|
|
|
if (arg[0] == 't')
|
|
|
|
|
model[-1] = *arg++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (arg[0] == '-')
|
|
|
|
|
arg++;
|
|
|
|
|
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (!startswith (arg, "11"))
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return 0;
|
|
|
|
|
arg += 2;
|
|
|
|
|
|
|
|
|
|
if (arg[0] == '-')
|
|
|
|
|
{
|
|
|
|
|
if (*++arg == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* Allow up to two revision letters. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
if (arg[0] != 0)
|
|
|
|
|
*model++ = *arg++;
|
|
|
|
|
if (arg[0] != 0)
|
|
|
|
|
*model++ = *arg++;
|
|
|
|
|
|
|
|
|
|
*model++ = 0;
|
|
|
|
|
|
|
|
|
|
set_option ("no-extensions");
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* KA11 (11/15/20). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (startswith (buf, "a"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
return 1; /* No extensions. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* KB11 (11/45/50/55/70). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "b"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
return set_option ("eis") && set_option ("spl");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* KD11-A (11/35/40). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "da"))
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return set_option ("limited-eis");
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* KD11-B (11/05/10). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "db")
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* KD11-D (11/04). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
|| startswith (buf, "dd"))
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return 1; /* no extensions */
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* KD11-E (11/34). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "de"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
return set_option ("eis") && set_option ("mxps");
|
|
|
|
|
|
|
|
|
|
/* KD11-F (11/03). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "df")
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* KD11-H (11/03). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
|| startswith (buf, "dh")
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* KD11-Q (11/03). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
|| startswith (buf, "dq"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
return set_option ("limited-eis") && set_option ("mxps");
|
|
|
|
|
|
|
|
|
|
/* KD11-K (11/60). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "dk"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
return set_option ("eis")
|
|
|
|
|
&& set_option ("mxps")
|
|
|
|
|
&& set_option ("ucode");
|
|
|
|
|
|
|
|
|
|
/* KD11-Z (11/44). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "dz"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
return set_option ("csm")
|
|
|
|
|
&& set_option ("eis")
|
|
|
|
|
&& set_option ("mfpt")
|
|
|
|
|
&& set_option ("mxps")
|
|
|
|
|
&& set_option ("spl");
|
|
|
|
|
|
|
|
|
|
/* F11 (11/23/24). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "f"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
return set_option ("eis")
|
|
|
|
|
&& set_option ("mfpt")
|
|
|
|
|
&& set_option ("mxps");
|
|
|
|
|
|
|
|
|
|
/* J11 (11/53/73/83/84/93/94). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "j"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
return set_option ("csm")
|
|
|
|
|
&& set_option ("eis")
|
|
|
|
|
&& set_option ("mfpt")
|
|
|
|
|
&& set_option ("multiproc")
|
|
|
|
|
&& set_option ("mxps")
|
|
|
|
|
&& set_option ("spl");
|
|
|
|
|
|
|
|
|
|
/* T11 (11/21). */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (buf, "t"))
|
2005-03-23 19:18:14 +08:00
|
|
|
|
return set_option ("limited-eis")
|
|
|
|
|
&& set_option ("mxps");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2016-02-27 22:35:32 +08:00
|
|
|
|
set_machine_model (const char *arg)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (!startswith (arg, "pdp-11/")
|
|
|
|
|
&& !startswith (arg, "pdp11/")
|
|
|
|
|
&& !startswith (arg, "11/"))
|
2001-02-19 07:33:11 +08:00
|
|
|
|
return 0;
|
|
|
|
|
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (startswith (arg, "pdp"))
|
2001-02-19 07:33:11 +08:00
|
|
|
|
arg += 3;
|
|
|
|
|
if (arg[0] == '-')
|
|
|
|
|
arg++;
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (startswith (arg, "11/"))
|
2001-02-19 07:33:11 +08:00
|
|
|
|
arg += 3;
|
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
if (strcmp (arg, "03") == 0)
|
|
|
|
|
return set_cpu_model ("kd11f");
|
|
|
|
|
|
|
|
|
|
else if (strcmp (arg, "04") == 0)
|
|
|
|
|
return set_cpu_model ("kd11d");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "05") == 0
|
|
|
|
|
|| strcmp (arg, "10") == 0)
|
|
|
|
|
return set_cpu_model ("kd11b");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "15") == 0
|
|
|
|
|
|| strcmp (arg, "20") == 0)
|
|
|
|
|
return set_cpu_model ("ka11");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "21") == 0)
|
|
|
|
|
return set_cpu_model ("t11");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "23") == 0
|
|
|
|
|
|| strcmp (arg, "24") == 0)
|
|
|
|
|
return set_cpu_model ("f11");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "34") == 0
|
|
|
|
|
|| strcmp (arg, "34a") == 0)
|
|
|
|
|
return set_cpu_model ("kd11e");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "35") == 0
|
|
|
|
|
|| strcmp (arg, "40") == 0)
|
|
|
|
|
return set_cpu_model ("kd11da");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "44") == 0)
|
|
|
|
|
return set_cpu_model ("kd11dz");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "45") == 0
|
|
|
|
|
|| strcmp (arg, "50") == 0
|
|
|
|
|
|| strcmp (arg, "55") == 0
|
|
|
|
|
|| strcmp (arg, "70") == 0)
|
|
|
|
|
return set_cpu_model ("kb11");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "60") == 0)
|
|
|
|
|
return set_cpu_model ("kd11k");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
else if (strcmp (arg, "53") == 0
|
|
|
|
|
|| strcmp (arg, "73") == 0
|
|
|
|
|
|| strcmp (arg, "83") == 0
|
|
|
|
|
|| strcmp (arg, "84") == 0
|
|
|
|
|
|| strcmp (arg, "93") == 0
|
|
|
|
|
|| strcmp (arg, "94") == 0)
|
|
|
|
|
return set_cpu_model ("j11")
|
|
|
|
|
&& set_option ("fpp");
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2002-06-08 15:37:16 +08:00
|
|
|
|
const char *md_shortopts = "m:";
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
struct option md_longopts[] =
|
|
|
|
|
{
|
|
|
|
|
#define OPTION_CPU 257
|
|
|
|
|
{ "cpu", required_argument, NULL, OPTION_CPU },
|
|
|
|
|
#define OPTION_MACHINE 258
|
|
|
|
|
{ "machine", required_argument, NULL, OPTION_MACHINE },
|
|
|
|
|
#define OPTION_PIC 259
|
|
|
|
|
{ "pic", no_argument, NULL, OPTION_PIC },
|
|
|
|
|
{ NULL, no_argument, NULL, 0 }
|
|
|
|
|
};
|
|
|
|
|
|
2001-07-23 22:02:13 +08:00
|
|
|
|
size_t md_longopts_size = sizeof (md_longopts);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2005-03-23 19:18:14 +08:00
|
|
|
|
/* Invocation line includes a switch not recognized by the base assembler.
|
|
|
|
|
See if it's a processor-specific option. */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
|
|
|
|
int
|
2016-02-27 22:35:32 +08:00
|
|
|
|
md_parse_option (int c, const char *arg)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
init_defaults ();
|
|
|
|
|
|
|
|
|
|
switch (c)
|
|
|
|
|
{
|
|
|
|
|
case 'm':
|
|
|
|
|
if (set_option (arg))
|
|
|
|
|
return 1;
|
|
|
|
|
if (set_cpu_model (arg))
|
|
|
|
|
return 1;
|
|
|
|
|
if (set_machine_model (arg))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case OPTION_CPU:
|
|
|
|
|
if (set_cpu_model (arg))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case OPTION_MACHINE:
|
|
|
|
|
if (set_machine_model (arg))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case OPTION_PIC:
|
|
|
|
|
if (set_option ("pic"))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_show_usage (FILE *stream)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
fprintf (stream, "\
|
|
|
|
|
\n\
|
2016-11-26 04:01:41 +08:00
|
|
|
|
PDP-11 instruction set extensions:\n\
|
2001-02-19 07:33:11 +08:00
|
|
|
|
\n\
|
2017-01-23 23:23:07 +08:00
|
|
|
|
-m(no-)cis allow (disallow) commercial instruction set\n\
|
2001-02-19 07:33:11 +08:00
|
|
|
|
-m(no-)csm allow (disallow) CSM instruction\n\
|
|
|
|
|
-m(no-)eis allow (disallow) full extended instruction set\n\
|
|
|
|
|
-m(no-)fis allow (disallow) KEV11 floating-point instructions\n\
|
|
|
|
|
-m(no-)fpp allow (disallow) FP-11 floating-point instructions\n\
|
|
|
|
|
-m(no-)fpu allow (disallow) FP-11 floating-point instructions\n\
|
|
|
|
|
-m(no-)limited-eis allow (disallow) limited extended instruction set\n\
|
|
|
|
|
-m(no-)mfpt allow (disallow) processor type instruction\n\
|
|
|
|
|
-m(no-)multiproc allow (disallow) multiprocessor instructions\n\
|
|
|
|
|
-m(no-)mxps allow (disallow) processor status instructions\n\
|
|
|
|
|
-m(no-)spl allow (disallow) SPL instruction\n\
|
|
|
|
|
-m(no-)ucode allow (disallow) microcode instructions\n\
|
|
|
|
|
-mall-extensions allow all instruction set extensions\n\
|
|
|
|
|
(this is the default)\n\
|
2017-01-23 23:23:07 +08:00
|
|
|
|
-mno-extensions disallow all instruction set extensions\n\
|
|
|
|
|
-pic generate position-independent code\n\
|
2001-02-19 07:33:11 +08:00
|
|
|
|
\n\
|
|
|
|
|
PDP-11 CPU model options:\n\
|
|
|
|
|
\n\
|
|
|
|
|
-mka11* KA11 CPU. base line instruction set only\n\
|
|
|
|
|
-mkb11* KB11 CPU. enable full EIS and SPL\n\
|
|
|
|
|
-mkd11a* KD11-A CPU. enable limited EIS\n\
|
|
|
|
|
-mkd11b* KD11-B CPU. base line instruction set only\n\
|
|
|
|
|
-mkd11d* KD11-D CPU. base line instruction set only\n\
|
|
|
|
|
-mkd11e* KD11-E CPU. enable full EIS, MTPS, and MFPS\n\
|
|
|
|
|
-mkd11f* KD11-F CPU. enable limited EIS, MTPS, and MFPS\n\
|
|
|
|
|
-mkd11h* KD11-H CPU. enable limited EIS, MTPS, and MFPS\n\
|
|
|
|
|
-mkd11q* KD11-Q CPU. enable limited EIS, MTPS, and MFPS\n\
|
|
|
|
|
-mkd11k* KD11-K CPU. enable full EIS, MTPS, MFPS, LDUB, MED,\n\
|
|
|
|
|
XFC, and MFPT\n\
|
|
|
|
|
-mkd11z* KD11-Z CPU. enable full EIS, MTPS, MFPS, MFPT, SPL,\n\
|
|
|
|
|
and CSM\n\
|
|
|
|
|
-mf11* F11 CPU. enable full EIS, MFPS, MTPS, and MFPT\n\
|
|
|
|
|
-mj11* J11 CPU. enable full EIS, MTPS, MFPS, MFPT, SPL,\n\
|
|
|
|
|
CSM, TSTSET, and WRTLCK\n\
|
|
|
|
|
-mt11* T11 CPU. enable limited EIS, MTPS, and MFPS\n\
|
|
|
|
|
\n\
|
|
|
|
|
PDP-11 machine model options:\n\
|
|
|
|
|
\n\
|
|
|
|
|
-m11/03 same as -mkd11f\n\
|
|
|
|
|
-m11/04 same as -mkd11d\n\
|
|
|
|
|
-m11/05 same as -mkd11b\n\
|
|
|
|
|
-m11/10 same as -mkd11b\n\
|
|
|
|
|
-m11/15 same as -mka11\n\
|
|
|
|
|
-m11/20 same as -mka11\n\
|
|
|
|
|
-m11/21 same as -mt11\n\
|
|
|
|
|
-m11/23 same as -mf11\n\
|
|
|
|
|
-m11/24 same as -mf11\n\
|
|
|
|
|
-m11/34 same as -mkd11e\n\
|
|
|
|
|
-m11/34a same as -mkd11e -mfpp\n\
|
|
|
|
|
-m11/35 same as -mkd11a\n\
|
|
|
|
|
-m11/40 same as -mkd11a\n\
|
|
|
|
|
-m11/44 same as -mkd11z\n\
|
|
|
|
|
-m11/45 same as -mkb11\n\
|
|
|
|
|
-m11/50 same as -mkb11\n\
|
|
|
|
|
-m11/53 same as -mj11\n\
|
|
|
|
|
-m11/55 same as -mkb11\n\
|
|
|
|
|
-m11/60 same as -mkd11k\n\
|
|
|
|
|
-m11/70 same as -mkb11\n\
|
|
|
|
|
-m11/73 same as -mj11\n\
|
|
|
|
|
-m11/83 same as -mj11\n\
|
|
|
|
|
-m11/84 same as -mj11\n\
|
|
|
|
|
-m11/93 same as -mj11\n\
|
|
|
|
|
-m11/94 same as -mj11\n\
|
|
|
|
|
");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
symbolS *
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
valueT
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_section_align (segT segment ATTRIBUTE_UNUSED,
|
|
|
|
|
valueT size)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
return (size + 1) & ~1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
long
|
2005-03-23 19:18:14 +08:00
|
|
|
|
md_pcrel_from (fixS *fixP)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
return fixP->fx_frag->fr_address + fixP->fx_where + fixP->fx_size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Translate internal representation of relocation info to BFD target
|
|
|
|
|
format. */
|
2005-03-23 19:18:14 +08:00
|
|
|
|
|
2001-02-19 07:33:11 +08:00
|
|
|
|
arelent *
|
2005-03-23 19:18:14 +08:00
|
|
|
|
tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
|
|
|
|
|
fixS *fixp)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
arelent *reloc;
|
|
|
|
|
bfd_reloc_code_real_type code;
|
|
|
|
|
|
2016-04-01 21:26:30 +08:00
|
|
|
|
reloc = XNEW (arelent);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2016-04-01 21:26:30 +08:00
|
|
|
|
reloc->sym_ptr_ptr = XNEW (asymbol *);
|
2001-02-19 07:33:11 +08:00
|
|
|
|
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
|
|
|
|
|
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
|
|
|
|
|
|
gas:
* cgen.c, cgen.h, tc.h, write.c, config/obj-coff.c
* config/tc-a29k.c, config/tc-alpha.c, config/tc-alpha.h
* config/tc-arc.c, config/tc-arc.h, config/tc-arm.c
* config/tc-arm.h, config/tc-avr.c, config/tc-avr.h
* config/tc-cris.c, config/tc-crx.c, config/tc-d10v.c
* config/tc-d10v.h, config/tc-d30v.c, config/tc-d30v.h
* config/tc-dlx.c, config/tc-dlx.h, config/tc-fr30.h
* config/tc-frv.c, config/tc-frv.h, config/tc-h8300.c
* config/tc-h8500.c, config/tc-hppa.c, config/tc-hppa.h
* config/tc-i370.c, config/tc-i370.h, config/tc-i386.c
* config/tc-i386.h, config/tc-i860.c, config/tc-i860.h
* config/tc-i960.c, config/tc-i960.h, config/tc-ia64.c
* config/tc-ip2k.c, config/tc-ip2k.h, config/tc-iq2000.c
* config/tc-iq2000.h, config/tc-m32r.c, config/tc-m32r.h
* config/tc-m68hc11.c, config/tc-m68hc11.h, config/tc-m68k.c
* config/tc-m68k.h, config/tc-m88k.c, config/tc-maxq.c
* config/tc-mcore.c, config/tc-mcore.h, config/tc-mips.c
* config/tc-mips.h, config/tc-mmix.c, config/tc-mn10200.c
* config/tc-mn10300.c, config/tc-msp430.c, config/tc-ns32k.c
* config/tc-openrisc.h, config/tc-or32.c, config/tc-or32.h
* config/tc-pdp11.c, config/tc-pj.c, config/tc-pj.h
* config/tc-ppc.c, config/tc-ppc.h, config/tc-s390.c
* config/tc-s390.h, config/tc-sh64.c, config/tc-sh.c
* config/tc-sh.h, config/tc-sparc.c, config/tc-sparc.h
* config/tc-tahoe.c, config/tc-tic30.c, config/tc-tic4x.c
* config/tc-tic54x.c, config/tc-tic80.c, config/tc-v850.c
* config/tc-v850.h, config/tc-vax.c, config/tc-vax.h
* config/tc-w65.c, config/tc-xstormy16.c, config/tc-xstormy16.h
* config/tc-xtensa.c, config/tc-z8k.c:
Replace all instances of the string "_apply_fix3" with
"_apply_fix".
* po/POTFILES.in, po/gas.pot: Regenerate.
bfd:
* coff-i386.c: Change md_apply_fix3 to md_apply_fix in comment.
cgen:
* doc/porting.texi: Change all mention of md_apply_fix3 and
gas_cgen_md_apply_fix3 to md_apply_fix and gas_cgen_md_apply_fix
respectively.
2005-06-08 01:54:22 +08:00
|
|
|
|
/* This is taken account for in md_apply_fix(). */
|
2001-02-19 07:33:11 +08:00
|
|
|
|
reloc->addend = -symbol_get_bfdsym (fixp->fx_addsy)->section->vma;
|
|
|
|
|
|
2020-02-20 21:05:21 +08:00
|
|
|
|
code = fixp->fx_r_type;
|
|
|
|
|
if (fixp->fx_pcrel)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
2020-02-20 21:05:21 +08:00
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case BFD_RELOC_16:
|
|
|
|
|
code = BFD_RELOC_16_PCREL;
|
|
|
|
|
break;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2020-02-20 21:05:21 +08:00
|
|
|
|
case BFD_RELOC_16_PCREL:
|
|
|
|
|
break;
|
2001-02-19 07:33:11 +08:00
|
|
|
|
|
2020-02-20 21:05:21 +08:00
|
|
|
|
default:
|
|
|
|
|
BAD_CASE (code);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2001-02-19 07:33:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
|
|
|
|
|
|
|
|
|
|
if (reloc->howto == NULL)
|
|
|
|
|
{
|
|
|
|
|
as_bad_where (fixp->fx_file, fixp->fx_line,
|
2009-07-24 19:45:01 +08:00
|
|
|
|
_("Can not represent %s relocation in this object file format"),
|
2001-02-19 07:33:11 +08:00
|
|
|
|
bfd_get_reloc_code_name (code));
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return reloc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
pseudo_bss (int c ATTRIBUTE_UNUSED)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
int temp;
|
|
|
|
|
|
|
|
|
|
temp = get_absolute_expression ();
|
|
|
|
|
subseg_set (bss_section, temp);
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-23 19:18:14 +08:00
|
|
|
|
pseudo_even (int c ATTRIBUTE_UNUSED)
|
2001-02-19 07:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
int alignment = 1; /* 2^1 */
|
|
|
|
|
frag_align (alignment, 0, 1);
|
|
|
|
|
record_alignment (now_seg, alignment);
|
|
|
|
|
}
|
2007-10-18 00:45:56 +08:00
|
|
|
|
|
2016-04-01 20:07:50 +08:00
|
|
|
|
const char *
|
2007-10-18 00:45:56 +08:00
|
|
|
|
md_atof (int type, char * litP, int * sizeP)
|
|
|
|
|
{
|
|
|
|
|
return vax_md_atof (type, litP, sizeP);
|
|
|
|
|
}
|