1999-05-03 15:29:11 +08:00
|
|
|
|
/* tc-v850.c -- Assembler code for the NEC V850
|
2024-01-04 19:52:08 +08:00
|
|
|
|
Copyright (C) 1996-2024 Free Software Foundation, Inc.
|
1999-05-03 15:29: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)
|
1999-05-03 15:29: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
|
2005-05-05 17:13:19 +08:00
|
|
|
|
the Free Software Foundation, 51 Franklin Street - Fifth Floor,
|
|
|
|
|
Boston, MA 02110-1301, USA. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
#include "as.h"
|
2001-09-19 13:33:36 +08:00
|
|
|
|
#include "safe-ctype.h"
|
2000-08-02 03:02:49 +08:00
|
|
|
|
#include "subsegs.h"
|
1999-05-03 15:29:11 +08:00
|
|
|
|
#include "opcode/v850.h"
|
2000-11-16 03:22:22 +08:00
|
|
|
|
#include "dwarf2dbg.h"
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Sign-extend a 16-bit number. */
|
|
|
|
|
#define SEXT16(x) ((((x) & 0xffff) ^ (~0x7fff)) + 0x8000)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
/* Set to TRUE if we want to be pedantic about signed overflows. */
|
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
|
|
|
|
static bool warn_signed_overflows = false;
|
|
|
|
|
static bool warn_unsigned_overflows = false;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2015-02-25 01:54:09 +08:00
|
|
|
|
/* Non-zero if floating point insns are not being used. */
|
|
|
|
|
static signed int soft_float = -1;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* Indicates the target BFD machine number. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
static int machine = -1;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2012-11-10 01:36:19 +08:00
|
|
|
|
|
2017-01-23 23:23:07 +08:00
|
|
|
|
/* Indicates the target BFD architecture. */
|
2016-05-17 06:04:17 +08:00
|
|
|
|
enum bfd_architecture v850_target_arch = bfd_arch_v850_rh850;
|
2012-11-10 01:36:19 +08:00
|
|
|
|
const char * v850_target_format = "elf32-v850-rh850";
|
|
|
|
|
static flagword v850_e_flags = 0;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* Indicates the target processor(s) for the assemble. */
|
2010-07-23 22:52:54 +08:00
|
|
|
|
static int processor_mask = 0;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
/* Structure to hold information about predefined registers. */
|
2005-03-25 04:40:28 +08:00
|
|
|
|
struct reg_name
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
const char *name;
|
|
|
|
|
int value;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
unsigned int processors;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
};
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Generic assembler global variables which must be defined by all
|
|
|
|
|
targets. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Characters which always start a comment. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
const char comment_chars[] = "#";
|
|
|
|
|
|
|
|
|
|
/* Characters which start a comment at the beginning of a line. */
|
|
|
|
|
const char line_comment_chars[] = ";#";
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Characters which may be used to separate multiple commands on a
|
1999-05-03 15:29:11 +08:00
|
|
|
|
single line. */
|
|
|
|
|
const char line_separator_chars[] = ";";
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Characters which are used to indicate an exponent in a floating
|
1999-05-03 15:29:11 +08:00
|
|
|
|
point number. */
|
|
|
|
|
const char EXP_CHARS[] = "eE";
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Characters which mean that a number is a floating point constant,
|
1999-05-03 15:29:11 +08:00
|
|
|
|
as in 0d1.0. */
|
|
|
|
|
const char FLT_CHARS[] = "dD";
|
|
|
|
|
|
2005-03-25 04:40:28 +08:00
|
|
|
|
const relax_typeS md_relax_table[] =
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* Conditional branches.(V850/V850E, max 22bit) */
|
|
|
|
|
#define SUBYPTE_COND_9_22 0
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_COND_9_22 + 1},
|
|
|
|
|
{0x1ffffe + 2, -0x200000 + 2, 6, 0},
|
|
|
|
|
/* Conditional branches.(V850/V850E, max 22bit) */
|
|
|
|
|
#define SUBYPTE_SA_9_22 2
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_SA_9_22 + 1},
|
|
|
|
|
{0x1ffffe + 4, -0x200000 + 4, 8, 0},
|
|
|
|
|
/* Unconditional branches.(V850/V850E, max 22bit) */
|
|
|
|
|
#define SUBYPTE_UNCOND_9_22 4
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_UNCOND_9_22 + 1},
|
|
|
|
|
{0x1ffffe, -0x200000, 4, 0},
|
|
|
|
|
/* Conditional branches.(V850E2, max 32bit) */
|
|
|
|
|
#define SUBYPTE_COND_9_22_32 6
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_COND_9_22_32 + 1},
|
|
|
|
|
{0x1fffff + 2, -0x200000 + 2, 6, SUBYPTE_COND_9_22_32 + 2},
|
|
|
|
|
{0x7ffffffe, -0x80000000, 8, 0},
|
|
|
|
|
/* Conditional branches.(V850E2, max 32bit) */
|
|
|
|
|
#define SUBYPTE_SA_9_22_32 9
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_SA_9_22_32 + 1},
|
|
|
|
|
{0x1ffffe + 4, -0x200000 + 4, 8, SUBYPTE_SA_9_22_32 + 2},
|
|
|
|
|
{0x7ffffffe, -0x80000000, 10, 0},
|
|
|
|
|
/* Unconditional branches.(V850E2, max 32bit) */
|
|
|
|
|
#define SUBYPTE_UNCOND_9_22_32 12
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_UNCOND_9_22_32 + 1},
|
|
|
|
|
{0x1ffffe, -0x200000, 4, SUBYPTE_UNCOND_9_22_32 + 2},
|
|
|
|
|
{0x7ffffffe, -0x80000000, 6, 0},
|
|
|
|
|
/* Conditional branches.(V850E2R max 22bit) */
|
|
|
|
|
#define SUBYPTE_COND_9_17_22 15
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_COND_9_17_22 + 1},
|
|
|
|
|
{0xfffe, -0x10000, 4, SUBYPTE_COND_9_17_22 + 2},
|
|
|
|
|
{0x1ffffe + 2, -0x200000 + 2, 6, 0},
|
|
|
|
|
/* Conditional branches.(V850E2R max 22bit) */
|
|
|
|
|
#define SUBYPTE_SA_9_17_22 18
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_SA_9_17_22 + 1},
|
|
|
|
|
{0xfffe, -0x10000, 4, SUBYPTE_SA_9_17_22 + 2},
|
|
|
|
|
{0x1ffffe + 4, -0x200000 + 4, 8, 0},
|
|
|
|
|
/* Conditional branches.(V850E2R max 32bit) */
|
|
|
|
|
#define SUBYPTE_COND_9_17_22_32 21
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_COND_9_17_22_32 + 1},
|
|
|
|
|
{0xfffe, -0x10000, 4, SUBYPTE_COND_9_17_22_32 + 2},
|
|
|
|
|
{0x1ffffe + 2, -0x200000 + 2, 6, SUBYPTE_COND_9_17_22_32 + 3},
|
|
|
|
|
{0x7ffffffe, -0x80000000, 8, 0},
|
|
|
|
|
/* Conditional branches.(V850E2R max 32bit) */
|
|
|
|
|
#define SUBYPTE_SA_9_17_22_32 25
|
|
|
|
|
{0xfe, -0x100, 2, SUBYPTE_SA_9_17_22_32 + 1},
|
|
|
|
|
{0xfffe, -0x10000, 4, SUBYPTE_SA_9_17_22_32 + 2},
|
|
|
|
|
{0x1ffffe + 4, -0x200000 + 4, 8, SUBYPTE_SA_9_17_22_32 + 3},
|
|
|
|
|
{0x7ffffffe, -0x80000000, 10, 0},
|
2013-01-24 19:14:05 +08:00
|
|
|
|
/* Loop. (V850E2V4_UP, max 22-bit). */
|
|
|
|
|
#define SUBYPTE_LOOP_16_22 29
|
|
|
|
|
{0x0, -0x0fffe, 4, SUBYPTE_LOOP_16_22 + 1},
|
|
|
|
|
{0x1ffffe + 2, -0x200000 + 2, 6, 0},
|
1999-05-03 15:29:11 +08:00
|
|
|
|
};
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
static int v850_relax = 0;
|
|
|
|
|
|
|
|
|
|
/* Default branch disp size 22 or 32. */
|
|
|
|
|
static int default_disp_size = 22;
|
|
|
|
|
|
|
|
|
|
/* Default no using bcond17. */
|
|
|
|
|
static int no_bcond17 = 0;
|
|
|
|
|
|
|
|
|
|
/* Default no using ld/st 23bit offset. */
|
|
|
|
|
static int no_stld23 = 0;
|
2002-08-29 14:49:35 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Fixups. */
|
2005-03-25 04:40:28 +08:00
|
|
|
|
#define MAX_INSN_FIXUPS 5
|
|
|
|
|
|
|
|
|
|
struct v850_fixup
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
expressionS exp;
|
|
|
|
|
int opindex;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
bfd_reloc_code_real_type reloc;
|
|
|
|
|
};
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
struct v850_fixup fixups[MAX_INSN_FIXUPS];
|
1999-05-03 15:29:11 +08:00
|
|
|
|
static int fc;
|
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
struct v850_seg_entry
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
segT s;
|
|
|
|
|
const char *name;
|
|
|
|
|
flagword flags;
|
|
|
|
|
};
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
struct v850_seg_entry v850_seg_table[] =
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
{ NULL, ".sdata",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS
|
|
|
|
|
| SEC_SMALL_DATA },
|
|
|
|
|
{ NULL, ".tdata",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS },
|
|
|
|
|
{ NULL, ".zdata",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS },
|
|
|
|
|
{ NULL, ".sbss",
|
|
|
|
|
SEC_ALLOC | SEC_SMALL_DATA },
|
|
|
|
|
{ NULL, ".tbss",
|
|
|
|
|
SEC_ALLOC },
|
|
|
|
|
{ NULL, ".zbss",
|
|
|
|
|
SEC_ALLOC},
|
|
|
|
|
{ NULL, ".rosdata",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | SEC_DATA
|
|
|
|
|
| SEC_HAS_CONTENTS | SEC_SMALL_DATA },
|
|
|
|
|
{ NULL, ".rozdata",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | SEC_DATA
|
|
|
|
|
| SEC_HAS_CONTENTS },
|
|
|
|
|
{ NULL, ".scommon",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS
|
|
|
|
|
| SEC_SMALL_DATA | SEC_IS_COMMON },
|
|
|
|
|
{ NULL, ".tcommon",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS
|
|
|
|
|
| SEC_IS_COMMON },
|
|
|
|
|
{ NULL, ".zcommon",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS
|
|
|
|
|
| SEC_IS_COMMON },
|
|
|
|
|
{ NULL, ".call_table_data",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS },
|
|
|
|
|
{ NULL, ".call_table_text",
|
|
|
|
|
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | SEC_CODE
|
|
|
|
|
| SEC_HAS_CONTENTS},
|
|
|
|
|
};
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
#define SDATA_SECTION 0
|
|
|
|
|
#define TDATA_SECTION 1
|
|
|
|
|
#define ZDATA_SECTION 2
|
|
|
|
|
#define SBSS_SECTION 3
|
|
|
|
|
#define TBSS_SECTION 4
|
|
|
|
|
#define ZBSS_SECTION 5
|
|
|
|
|
#define ROSDATA_SECTION 6
|
|
|
|
|
#define ROZDATA_SECTION 7
|
|
|
|
|
#define SCOMMON_SECTION 8
|
|
|
|
|
#define TCOMMON_SECTION 9
|
|
|
|
|
#define ZCOMMON_SECTION 10
|
|
|
|
|
#define CALL_TABLE_DATA_SECTION 11
|
|
|
|
|
#define CALL_TABLE_TEXT_SECTION 12
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
do_v850_seg (int i, subsegT sub)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
struct v850_seg_entry *seg = v850_seg_table + i;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
obj_elf_section_change_hook ();
|
2005-03-25 04:40:28 +08:00
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
if (seg->s != NULL)
|
2005-03-25 04:40:28 +08:00
|
|
|
|
subseg_set (seg->s, sub);
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
seg->s = subseg_new (seg->name, sub);
|
bfd_section_* macros
This large patch removes the unnecessary bfd parameter from various
bfd section macros and functions. The bfd is hardly ever used and if
needed for the bfd_set_section_* or bfd_rename_section functions can
be found via section->owner except for the com, und, abs, and ind
std_section special sections. Those sections shouldn't be modified
anyway.
The patch also removes various bfd_get_section_<field> macros,
replacing their use with bfd_section_<field>, and adds
bfd_set_section_lma. I've also fixed a minor bug in gas where
compressed section renaming was done directly rather than calling
bfd_rename_section. This would have broken bfd_get_section_by_name
and similar functions, but that hardly mattered at such a late stage
in gas processing.
bfd/
* bfd-in.h (bfd_get_section_name, bfd_get_section_vma),
(bfd_get_section_lma, bfd_get_section_alignment),
(bfd_get_section_size, bfd_get_section_flags),
(bfd_get_section_userdata): Delete.
(bfd_section_name, bfd_section_size, bfd_section_vma),
(bfd_section_lma, bfd_section_alignment): Lose bfd parameter.
(bfd_section_flags, bfd_section_userdata): New.
(bfd_is_com_section): Rename parameter.
* section.c (bfd_set_section_userdata, bfd_set_section_vma),
(bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section),
(bfd_set_section_size): Delete bfd parameter, rename section parameter.
(bfd_set_section_lma): New.
* bfd-in2.h: Regenerate.
* mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param,
update callers.
* aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h,
* elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c,
* elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c,
* elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c,
* elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c,
* elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c,
* elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c,
* elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c,
* elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
* elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
* elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c,
* elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
* elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c,
* elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c,
* mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c,
* peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c,
* xcofflink.c: Update throughout for bfd section macro and function
changes.
binutils/
* addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c,
* objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c,
* od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c,
* resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update
throughout for bfd section macro and function changes.
gas/
* as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c,
* read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c,
* config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c,
* config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c,
* config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
* config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c,
* config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c,
* config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c,
* config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c,
* config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c,
* config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c,
* config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c,
* config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c,
* config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c,
* config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c,
* config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c,
* config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c,
* config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c,
* config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c,
* config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c,
* config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c,
* config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c,
* config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for
bfd section macro and function changes.
* write.c (compress_debug): Use bfd_rename_section.
gdb/
* aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c,
* coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c,
* dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c,
* exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h,
* hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c,
* i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c,
* maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c,
* mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c,
* objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c,
* ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c,
* rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c,
* s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c,
* solib-spu.c, * solib-svr4.c, * solib-target.c,
* spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c,
* symmisc.c, * symtab.c, * target.c, * windows-nat.c,
* xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c,
* mi/mi-interp.c: Update throughout for bfd section macro and
function changes.
* gcore (gcore_create_callback): Use bfd_set_section_lma.
* spu-tdep.c (spu_overlay_new_objfile): Likewise.
gprof/
* corefile.c, * symtab.c: Update throughout for bfd section
macro and function changes.
ld/
* ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c,
* emultempl/aarch64elf.em, * emultempl/aix.em,
* emultempl/armcoff.em, * emultempl/armelf.em,
* emultempl/cr16elf.em, * emultempl/cskyelf.em,
* emultempl/m68hc1xelf.em, * emultempl/m68kelf.em,
* emultempl/mipself.em, * emultempl/mmix-elfnmmo.em,
* emultempl/mmo.em, * emultempl/msp430.em,
* emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em,
* emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update
throughout for bfd section macro and function changes.
libctf/
* ctf-open-bfd.c: Update throughout for bfd section macro changes.
opcodes/
* arc-ext.c: Update throughout for bfd section macro changes.
sim/
* common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c,
* erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c,
* m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c,
* rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c,
* rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 18:55:17 +08:00
|
|
|
|
bfd_set_section_flags (seg->s, seg->flags);
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
if ((seg->flags & SEC_LOAD) == 0)
|
|
|
|
|
seg_info (seg->s)->bss = 1;
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
static void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
v850_seg (int i)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
subsegT sub = get_absolute_expression ();
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
do_v850_seg (i, sub);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
static void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
v850_offset (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2002-09-27 06:04:19 +08:00
|
|
|
|
char *pfrag;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
int temp = get_absolute_expression ();
|
2003-06-24 19:10:47 +08:00
|
|
|
|
|
2002-09-27 06:04:19 +08:00
|
|
|
|
pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, (symbolS *)0,
|
2003-07-15 12:04:18 +08:00
|
|
|
|
(offsetT) temp, (char *) 0);
|
2002-09-27 06:04:19 +08:00
|
|
|
|
*pfrag = 0;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Copied from obj_elf_common() in gas/config/obj-elf.c. */
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
static void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
v850_comm (int area)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
char *name;
|
|
|
|
|
char c;
|
|
|
|
|
char *p;
|
|
|
|
|
int temp;
|
|
|
|
|
unsigned int size;
|
|
|
|
|
symbolS *symbolP;
|
|
|
|
|
int have_align;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2015-08-21 23:42:14 +08:00
|
|
|
|
c = get_symbol_name (&name);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
/* Just after name is now '\0'. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
p = input_line_pointer;
|
|
|
|
|
*p = c;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
SKIP_WHITESPACE ();
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (*input_line_pointer != ',')
|
|
|
|
|
{
|
|
|
|
|
as_bad (_("Expected comma after symbol-name"));
|
|
|
|
|
ignore_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
/* Skip ','. */
|
|
|
|
|
input_line_pointer++;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if ((temp = get_absolute_expression ()) < 0)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* xgettext:c-format */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
as_bad (_(".COMMon length (%d.) < 0! Ignored."), temp);
|
|
|
|
|
ignore_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
size = temp;
|
|
|
|
|
*p = 0;
|
|
|
|
|
symbolP = symbol_find_or_make (name);
|
|
|
|
|
*p = c;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP))
|
|
|
|
|
{
|
|
|
|
|
as_bad (_("Ignoring attempt to re-define symbol"));
|
|
|
|
|
ignore_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (S_GET_VALUE (symbolP) != 0)
|
|
|
|
|
{
|
|
|
|
|
if (S_GET_VALUE (symbolP) != size)
|
2005-03-25 04:40:28 +08:00
|
|
|
|
/* xgettext:c-format */
|
|
|
|
|
as_warn (_("Length of .comm \"%s\" is already %ld. Not changed to %d."),
|
|
|
|
|
S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
know (symbol_get_frag (symbolP) == &zero_address_frag);
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (*input_line_pointer != ',')
|
|
|
|
|
have_align = 0;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
have_align = 1;
|
|
|
|
|
input_line_pointer++;
|
|
|
|
|
SKIP_WHITESPACE ();
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (! have_align || *input_line_pointer != '"')
|
|
|
|
|
{
|
|
|
|
|
if (! have_align)
|
|
|
|
|
temp = 0;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
temp = get_absolute_expression ();
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (temp < 0)
|
|
|
|
|
{
|
|
|
|
|
temp = 0;
|
|
|
|
|
as_warn (_("Common alignment negative; 0 assumed"));
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-07-07 17:34:14 +08:00
|
|
|
|
if (symbol_get_obj (symbolP)->local)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
segT old_sec;
|
|
|
|
|
int old_subsec;
|
|
|
|
|
char *pfrag;
|
|
|
|
|
int align;
|
|
|
|
|
flagword applicable;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
old_sec = now_seg;
|
|
|
|
|
old_subsec = now_subseg;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
applicable = bfd_applicable_section_flags (stdoutput);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
applicable &= SEC_ALLOC;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
switch (area)
|
|
|
|
|
{
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case SCOMMON_SECTION:
|
|
|
|
|
do_v850_seg (SBSS_SECTION, 0);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case ZCOMMON_SECTION:
|
|
|
|
|
do_v850_seg (ZBSS_SECTION, 0);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case TCOMMON_SECTION:
|
|
|
|
|
do_v850_seg (TBSS_SECTION, 0);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Convert to a power of 2 alignment. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
for (align = 0; (temp & 1) == 0; temp >>= 1, ++align)
|
|
|
|
|
;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (temp != 1)
|
|
|
|
|
{
|
|
|
|
|
as_bad (_("Common alignment not a power of 2"));
|
|
|
|
|
ignore_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
align = 0;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
record_alignment (now_seg, align);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (align)
|
|
|
|
|
frag_align (align, 0, 0);
|
|
|
|
|
|
|
|
|
|
switch (area)
|
|
|
|
|
{
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case SCOMMON_SECTION:
|
|
|
|
|
if (S_GET_SEGMENT (symbolP) == v850_seg_table[SBSS_SECTION].s)
|
1999-06-22 22:53:01 +08:00
|
|
|
|
symbol_get_frag (symbolP)->fr_symbol = 0;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case ZCOMMON_SECTION:
|
|
|
|
|
if (S_GET_SEGMENT (symbolP) == v850_seg_table[ZBSS_SECTION].s)
|
1999-06-22 22:53:01 +08:00
|
|
|
|
symbol_get_frag (symbolP)->fr_symbol = 0;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case TCOMMON_SECTION:
|
|
|
|
|
if (S_GET_SEGMENT (symbolP) == v850_seg_table[TBSS_SECTION].s)
|
1999-06-22 22:53:01 +08:00
|
|
|
|
symbol_get_frag (symbolP)->fr_symbol = 0;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
1999-07-07 17:34:14 +08:00
|
|
|
|
abort ();
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-06-22 22:53:01 +08:00
|
|
|
|
symbol_set_frag (symbolP, frag_now);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP,
|
|
|
|
|
(offsetT) size, (char *) 0);
|
|
|
|
|
*pfrag = 0;
|
|
|
|
|
S_SET_SIZE (symbolP, size);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
switch (area)
|
|
|
|
|
{
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case SCOMMON_SECTION:
|
|
|
|
|
S_SET_SEGMENT (symbolP, v850_seg_table[SBSS_SECTION].s);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case ZCOMMON_SECTION:
|
|
|
|
|
S_SET_SEGMENT (symbolP, v850_seg_table[ZBSS_SECTION].s);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case TCOMMON_SECTION:
|
|
|
|
|
S_SET_SEGMENT (symbolP, v850_seg_table[TBSS_SECTION].s);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
default:
|
2000-08-02 03:02:49 +08:00
|
|
|
|
abort ();
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
S_CLEAR_EXTERNAL (symbolP);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
obj_elf_section_change_hook ();
|
1999-05-03 15:29:11 +08:00
|
|
|
|
subseg_set (old_sec, old_subsec);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2003-07-15 12:04:18 +08:00
|
|
|
|
segT old_sec;
|
|
|
|
|
int old_subsec;
|
2002-08-29 14:49:35 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
allocate_common:
|
2003-07-15 12:04:18 +08:00
|
|
|
|
old_sec = now_seg;
|
|
|
|
|
old_subsec = now_subseg;
|
2002-08-29 14:49:35 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
S_SET_VALUE (symbolP, (valueT) size);
|
|
|
|
|
S_SET_ALIGN (symbolP, temp);
|
|
|
|
|
S_SET_EXTERNAL (symbolP);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
switch (area)
|
|
|
|
|
{
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
case SCOMMON_SECTION:
|
|
|
|
|
case ZCOMMON_SECTION:
|
|
|
|
|
case TCOMMON_SECTION:
|
|
|
|
|
do_v850_seg (area, 0);
|
|
|
|
|
S_SET_SEGMENT (symbolP, v850_seg_table[area].s);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
default:
|
2000-08-02 03:02:49 +08:00
|
|
|
|
abort ();
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2002-08-29 14:49:35 +08:00
|
|
|
|
|
|
|
|
|
obj_elf_section_change_hook ();
|
|
|
|
|
subseg_set (old_sec, old_subsec);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
input_line_pointer++;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* @@ Some use the dot, some don't. Can we get some consistency?? */
|
|
|
|
|
if (*input_line_pointer == '.')
|
|
|
|
|
input_line_pointer++;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* @@ Some say data, some say bss. */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (!startswith (input_line_pointer, "bss\"")
|
|
|
|
|
&& !startswith (input_line_pointer, "data\""))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
while (*--input_line_pointer != '"')
|
|
|
|
|
;
|
|
|
|
|
input_line_pointer--;
|
|
|
|
|
goto bad_common_segment;
|
|
|
|
|
}
|
2005-03-25 04:40:28 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
while (*input_line_pointer++ != '"')
|
|
|
|
|
;
|
2005-03-25 04:40:28 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
goto allocate_common;
|
|
|
|
|
}
|
|
|
|
|
|
1999-06-22 22:17:55 +08:00
|
|
|
|
symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bad_common_segment:
|
|
|
|
|
p = input_line_pointer;
|
|
|
|
|
while (*p && *p != '\n')
|
|
|
|
|
p++;
|
|
|
|
|
c = *p;
|
|
|
|
|
*p = '\0';
|
|
|
|
|
as_bad (_("bad .common segment %s"), input_line_pointer + 1);
|
|
|
|
|
*p = c;
|
|
|
|
|
input_line_pointer = p;
|
|
|
|
|
ignore_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
static void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
set_machine (int number)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
machine = number;
|
2012-11-10 01:36:19 +08:00
|
|
|
|
bfd_set_arch_mach (stdoutput, v850_target_arch, machine);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
switch (machine)
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
case 0: SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850); break;
|
|
|
|
|
case bfd_mach_v850: SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850); break;
|
|
|
|
|
case bfd_mach_v850e: SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E); break;
|
|
|
|
|
case bfd_mach_v850e1: SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E); break;
|
|
|
|
|
case bfd_mach_v850e2: SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E2); break;
|
|
|
|
|
case bfd_mach_v850e2v3:SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E2V3); break;
|
2013-01-24 19:14:05 +08:00
|
|
|
|
case bfd_mach_v850e3v5: SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E3V5); break;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-29 14:49:35 +08:00
|
|
|
|
static void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
v850_longcode (int type)
|
2002-08-29 14:49:35 +08:00
|
|
|
|
{
|
|
|
|
|
expressionS ex;
|
|
|
|
|
|
|
|
|
|
if (! v850_relax)
|
|
|
|
|
{
|
|
|
|
|
if (type == 1)
|
2009-07-24 19:45:01 +08:00
|
|
|
|
as_warn (_(".longcall pseudo-op seen when not relaxing"));
|
2002-08-29 14:49:35 +08:00
|
|
|
|
else
|
2009-07-24 19:45:01 +08:00
|
|
|
|
as_warn (_(".longjump pseudo-op seen when not relaxing"));
|
2002-08-29 14:49:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expression (&ex);
|
|
|
|
|
|
|
|
|
|
if (ex.X_op != O_symbol || ex.X_add_number != 0)
|
|
|
|
|
{
|
2009-07-24 19:45:01 +08:00
|
|
|
|
as_bad (_("bad .longcall format"));
|
2002-08-29 14:49:35 +08:00
|
|
|
|
ignore_rest_of_line ();
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-15 12:04:18 +08:00
|
|
|
|
if (type == 1)
|
2002-08-29 14:49:35 +08:00
|
|
|
|
fix_new_exp (frag_now, frag_now_fix (), 4, & ex, 1,
|
|
|
|
|
BFD_RELOC_V850_LONGCALL);
|
|
|
|
|
else
|
|
|
|
|
fix_new_exp (frag_now, frag_now_fix (), 4, & ex, 1,
|
|
|
|
|
BFD_RELOC_V850_LONGJUMP);
|
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* The target specific pseudo-ops which we support. */
|
2003-02-21 20:33:34 +08:00
|
|
|
|
const pseudo_typeS md_pseudo_table[] =
|
|
|
|
|
{
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
{ "sdata", v850_seg, SDATA_SECTION },
|
|
|
|
|
{ "tdata", v850_seg, TDATA_SECTION },
|
|
|
|
|
{ "zdata", v850_seg, ZDATA_SECTION },
|
|
|
|
|
{ "sbss", v850_seg, SBSS_SECTION },
|
|
|
|
|
{ "tbss", v850_seg, TBSS_SECTION },
|
|
|
|
|
{ "zbss", v850_seg, ZBSS_SECTION },
|
|
|
|
|
{ "rosdata", v850_seg, ROSDATA_SECTION },
|
|
|
|
|
{ "rozdata", v850_seg, ROZDATA_SECTION },
|
|
|
|
|
{ "offset", v850_offset, 0 },
|
|
|
|
|
{ "word", cons, 4 },
|
|
|
|
|
{ "zcomm", v850_comm, ZCOMMON_SECTION },
|
|
|
|
|
{ "scomm", v850_comm, SCOMMON_SECTION },
|
|
|
|
|
{ "tcomm", v850_comm, TCOMMON_SECTION },
|
|
|
|
|
{ "v850", set_machine, 0 },
|
|
|
|
|
{ "call_table_data", v850_seg, CALL_TABLE_DATA_SECTION },
|
|
|
|
|
{ "call_table_text", v850_seg, CALL_TABLE_TEXT_SECTION },
|
|
|
|
|
{ "v850e", set_machine, bfd_mach_v850e },
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "v850e1", set_machine, bfd_mach_v850e1 },
|
|
|
|
|
{ "v850e2", set_machine, bfd_mach_v850e2 },
|
|
|
|
|
{ "v850e2v3", set_machine, bfd_mach_v850e2v3 },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "v850e2v4", set_machine, bfd_mach_v850e3v5 },
|
|
|
|
|
{ "v850e3v5", set_machine, bfd_mach_v850e3v5 },
|
2003-07-15 12:04:18 +08:00
|
|
|
|
{ "longcall", v850_longcode, 1 },
|
|
|
|
|
{ "longjump", v850_longcode, 2 },
|
* config/tc-v850.c: Add missing prototypes amd use old-style
function definitions.
(AREA_ZDA, AREA_SDA, AREA_TDA): Delete.
(sdata_section tdata_section, zdata_section, sbss_section,
tbss_section, zbss_section, rosdata_section, rozdata_section,
scommon_section, tcommon_section, zcommon_section,
call_table_data_section, call_table_text_section): Delete.
(v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
v850_zbss, v850_bss, v850_rosdata, v850_rozdata,
v850_call_table_data, v850_call_table_text): Delete.
(struct v850_seg_entry): New.
(v850_seg_table): New.
(SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION,
TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION,
ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION,
CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define.
(do_v850_seg): New.
(v850_seg): New.
(v850_comm): Use do_v850_seg and v850_seg_table. Simplify
recording of alignment.
(md_pseudo_table): Use v850_seg.
(md_begin): Don't init .call_table_data and .call_table_text here.
Set v850_seg_table bss entry.
* config/tc-v850.h (v850_pcrel_from_section): Prototype.
* gas/elf/elf.exp: Don't special case v850.
2002-02-02 00:29:21 +08:00
|
|
|
|
{ NULL, NULL, 0 }
|
1999-05-03 15:29:11 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Opcode hash table. */
|
2020-08-18 16:57:21 +08:00
|
|
|
|
static htab_t v850_hash;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* This table is sorted. Suitable for searching by a binary search. */
|
2003-02-21 20:33:34 +08:00
|
|
|
|
static const struct reg_name pre_defined_registers[] =
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "ep", 30, PROCESSOR_ALL }, /* ep - element ptr. */
|
|
|
|
|
{ "gp", 4, PROCESSOR_ALL }, /* gp - global ptr. */
|
|
|
|
|
{ "hp", 2, PROCESSOR_ALL }, /* hp - handler stack ptr. */
|
|
|
|
|
{ "lp", 31, PROCESSOR_ALL }, /* lp - link ptr. */
|
|
|
|
|
{ "r0", 0, PROCESSOR_ALL },
|
|
|
|
|
{ "r1", 1, PROCESSOR_ALL },
|
|
|
|
|
{ "r10", 10, PROCESSOR_ALL },
|
|
|
|
|
{ "r11", 11, PROCESSOR_ALL },
|
|
|
|
|
{ "r12", 12, PROCESSOR_ALL },
|
|
|
|
|
{ "r13", 13, PROCESSOR_ALL },
|
|
|
|
|
{ "r14", 14, PROCESSOR_ALL },
|
|
|
|
|
{ "r15", 15, PROCESSOR_ALL },
|
|
|
|
|
{ "r16", 16, PROCESSOR_ALL },
|
|
|
|
|
{ "r17", 17, PROCESSOR_ALL },
|
|
|
|
|
{ "r18", 18, PROCESSOR_ALL },
|
|
|
|
|
{ "r19", 19, PROCESSOR_ALL },
|
|
|
|
|
{ "r2", 2, PROCESSOR_ALL },
|
|
|
|
|
{ "r20", 20, PROCESSOR_ALL },
|
|
|
|
|
{ "r21", 21, PROCESSOR_ALL },
|
|
|
|
|
{ "r22", 22, PROCESSOR_ALL },
|
|
|
|
|
{ "r23", 23, PROCESSOR_ALL },
|
|
|
|
|
{ "r24", 24, PROCESSOR_ALL },
|
|
|
|
|
{ "r25", 25, PROCESSOR_ALL },
|
|
|
|
|
{ "r26", 26, PROCESSOR_ALL },
|
|
|
|
|
{ "r27", 27, PROCESSOR_ALL },
|
|
|
|
|
{ "r28", 28, PROCESSOR_ALL },
|
|
|
|
|
{ "r29", 29, PROCESSOR_ALL },
|
|
|
|
|
{ "r3", 3, PROCESSOR_ALL },
|
|
|
|
|
{ "r30", 30, PROCESSOR_ALL },
|
|
|
|
|
{ "r31", 31, PROCESSOR_ALL },
|
|
|
|
|
{ "r4", 4, PROCESSOR_ALL },
|
|
|
|
|
{ "r5", 5, PROCESSOR_ALL },
|
|
|
|
|
{ "r6", 6, PROCESSOR_ALL },
|
|
|
|
|
{ "r7", 7, PROCESSOR_ALL },
|
|
|
|
|
{ "r8", 8, PROCESSOR_ALL },
|
|
|
|
|
{ "r9", 9, PROCESSOR_ALL },
|
|
|
|
|
{ "sp", 3, PROCESSOR_ALL }, /* sp - stack ptr. */
|
|
|
|
|
{ "tp", 5, PROCESSOR_ALL }, /* tp - text ptr. */
|
|
|
|
|
{ "zero", 0, PROCESSOR_ALL },
|
1999-05-03 15:29:11 +08:00
|
|
|
|
};
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
#define REG_NAME_CNT \
|
|
|
|
|
(sizeof (pre_defined_registers) / sizeof (struct reg_name))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
static const struct reg_name system_registers[] =
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "asid", 23, PROCESSOR_NOT_V850 },
|
|
|
|
|
{ "bpam", 25, PROCESSOR_NOT_V850 },
|
|
|
|
|
{ "bpav", 24, PROCESSOR_NOT_V850 },
|
|
|
|
|
{ "bpc", 22, PROCESSOR_NOT_V850 },
|
|
|
|
|
{ "bpdm", 27, PROCESSOR_NOT_V850 },
|
|
|
|
|
{ "bpdv", 26, PROCESSOR_NOT_V850 },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "bsel", 31, PROCESSOR_V850E2_UP },
|
|
|
|
|
{ "cfg", 7, PROCESSOR_V850E2V3_UP },
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "ctbp", 20, PROCESSOR_NOT_V850 },
|
|
|
|
|
{ "ctpc", 16, PROCESSOR_NOT_V850 },
|
|
|
|
|
{ "ctpsw", 17, PROCESSOR_NOT_V850 },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "dbic", 15, PROCESSOR_V850E2_UP },
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "dbpc", 18, PROCESSOR_NOT_V850 },
|
|
|
|
|
{ "dbpsw", 19, PROCESSOR_NOT_V850 },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "dbwr", 30, PROCESSOR_V850E2_UP },
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "dir", 21, PROCESSOR_NOT_V850 },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "dpa0l", 16, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa0u", 17, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa1l", 18, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa1u", 19, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa2l", 20, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa2u", 21, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa3l", 22, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa3u", 23, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa4l", 24, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa4u", 25, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa5l", 26, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "dpa5u", 27, PROCESSOR_V850E2V3_UP },
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "ecr", 4, PROCESSOR_ALL },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "eh_base", 3, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "eh_cfg", 1, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "eh_reset", 2, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "eiic", 13, PROCESSOR_V850E2_UP },
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "eipc", 0, PROCESSOR_ALL },
|
|
|
|
|
{ "eipsw", 1, PROCESSOR_ALL },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "eiwr", 28, PROCESSOR_V850E2_UP },
|
|
|
|
|
{ "feic", 14, PROCESSOR_V850E2_UP },
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "fepc", 2, PROCESSOR_ALL },
|
|
|
|
|
{ "fepsw", 3, PROCESSOR_ALL },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "fewr", 29, PROCESSOR_V850E2_UP },
|
|
|
|
|
{ "fpcc", 9, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "fpcfg", 10, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "fpec", 11, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "fpepc", 7, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "fpspc", 27, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "fpsr", 6, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "fpst", 8, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa0l", 6, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa0u", 7, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa1l", 8, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa1u", 9, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa2l", 10, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa2u", 11, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa3l", 12, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa3u", 13, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa4l", 14, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "ipa4u", 15, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mca", 24, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mcc", 26, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mcr", 27, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mcs", 25, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpc", 1, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpm", 0, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa0l", 16, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa0u", 17, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa1l", 18, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa1u", 19, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa2l", 20, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa2u", 21, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa3l", 22, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa3u", 23, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa4l", 24, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa4u", 25, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa5l", 26, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_dpa5u", 27, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa0l", 6, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa0u", 7, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa1l", 8, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa1u", 9, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa2l", 10, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa2u", 11, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa3l", 12, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa3u", 13, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa4l", 14, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_ipa4u", 15, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_mpc", 1, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_mpm", 0, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_tid", 2, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_vmadr", 5, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_vmecr", 3, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "mpu10_vmtid", 4, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "pid", 6, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "pmcr0", 4, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "pmis2", 14, PROCESSOR_V850E2V3_UP },
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "psw", 5, PROCESSOR_ALL },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "scbp", 12, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "sccfg", 11, PROCESSOR_V850E2V3_UP },
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "sr0", 0, PROCESSOR_ALL },
|
|
|
|
|
{ "sr1", 1, PROCESSOR_ALL },
|
|
|
|
|
{ "sr10", 10, PROCESSOR_ALL },
|
|
|
|
|
{ "sr11", 11, PROCESSOR_ALL },
|
|
|
|
|
{ "sr12", 12, PROCESSOR_ALL },
|
|
|
|
|
{ "sr13", 13, PROCESSOR_ALL },
|
|
|
|
|
{ "sr14", 14, PROCESSOR_ALL },
|
|
|
|
|
{ "sr15", 15, PROCESSOR_ALL },
|
|
|
|
|
{ "sr16", 16, PROCESSOR_ALL },
|
|
|
|
|
{ "sr17", 17, PROCESSOR_ALL },
|
|
|
|
|
{ "sr18", 18, PROCESSOR_ALL },
|
|
|
|
|
{ "sr19", 19, PROCESSOR_ALL },
|
|
|
|
|
{ "sr2", 2, PROCESSOR_ALL },
|
|
|
|
|
{ "sr20", 20, PROCESSOR_ALL },
|
|
|
|
|
{ "sr21", 21, PROCESSOR_ALL },
|
|
|
|
|
{ "sr22", 22, PROCESSOR_ALL },
|
|
|
|
|
{ "sr23", 23, PROCESSOR_ALL },
|
|
|
|
|
{ "sr24", 24, PROCESSOR_ALL },
|
|
|
|
|
{ "sr25", 25, PROCESSOR_ALL },
|
|
|
|
|
{ "sr26", 26, PROCESSOR_ALL },
|
|
|
|
|
{ "sr27", 27, PROCESSOR_ALL },
|
|
|
|
|
{ "sr28", 28, PROCESSOR_ALL },
|
|
|
|
|
{ "sr29", 29, PROCESSOR_ALL },
|
|
|
|
|
{ "sr3", 3, PROCESSOR_ALL },
|
|
|
|
|
{ "sr30", 30, PROCESSOR_ALL },
|
|
|
|
|
{ "sr31", 31, PROCESSOR_ALL },
|
|
|
|
|
{ "sr4", 4, PROCESSOR_ALL },
|
|
|
|
|
{ "sr5", 5, PROCESSOR_ALL },
|
|
|
|
|
{ "sr6", 6, PROCESSOR_ALL },
|
|
|
|
|
{ "sr7", 7, PROCESSOR_ALL },
|
|
|
|
|
{ "sr8", 8, PROCESSOR_ALL },
|
|
|
|
|
{ "sr9", 9, PROCESSOR_ALL },
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "sw_base", 3, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "sw_cfg", 1, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "sw_ctl", 0, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "tid", 2, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "vmadr", 6, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "vmecr", 4, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "vmtid", 5, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "vsadr", 2, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "vsecr", 0, PROCESSOR_V850E2V3_UP },
|
|
|
|
|
{ "vstid", 1, PROCESSOR_V850E2V3_UP },
|
1999-05-03 15:29:11 +08:00
|
|
|
|
};
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
#define SYSREG_NAME_CNT \
|
|
|
|
|
(sizeof (system_registers) / sizeof (struct reg_name))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
static const struct reg_name cc_names[] =
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{ "c", 0x1, PROCESSOR_ALL },
|
|
|
|
|
{ "e", 0x2, PROCESSOR_ALL },
|
|
|
|
|
{ "ge", 0xe, PROCESSOR_ALL },
|
|
|
|
|
{ "gt", 0xf, PROCESSOR_ALL },
|
|
|
|
|
{ "h", 0xb, PROCESSOR_ALL },
|
|
|
|
|
{ "l", 0x1, PROCESSOR_ALL },
|
|
|
|
|
{ "le", 0x7, PROCESSOR_ALL },
|
|
|
|
|
{ "lt", 0x6, PROCESSOR_ALL },
|
|
|
|
|
{ "n", 0x4, PROCESSOR_ALL },
|
|
|
|
|
{ "nc", 0x9, PROCESSOR_ALL },
|
|
|
|
|
{ "ne", 0xa, PROCESSOR_ALL },
|
|
|
|
|
{ "nh", 0x3, PROCESSOR_ALL },
|
|
|
|
|
{ "nl", 0x9, PROCESSOR_ALL },
|
|
|
|
|
{ "ns", 0xc, PROCESSOR_ALL },
|
|
|
|
|
{ "nv", 0x8, PROCESSOR_ALL },
|
|
|
|
|
{ "nz", 0xa, PROCESSOR_ALL },
|
|
|
|
|
{ "p", 0xc, PROCESSOR_ALL },
|
|
|
|
|
{ "s", 0x4, PROCESSOR_ALL },
|
|
|
|
|
#define COND_SA_NUM 0xd
|
|
|
|
|
{ "sa", COND_SA_NUM, PROCESSOR_ALL },
|
|
|
|
|
{ "t", 0x5, PROCESSOR_ALL },
|
|
|
|
|
{ "v", 0x0, PROCESSOR_ALL },
|
|
|
|
|
{ "z", 0x2, PROCESSOR_ALL },
|
1999-05-03 15:29:11 +08:00
|
|
|
|
};
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
#define CC_NAME_CNT \
|
|
|
|
|
(sizeof (cc_names) / sizeof (struct reg_name))
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
static const struct reg_name float_cc_names[] =
|
|
|
|
|
{
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{ "eq", 0x2, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "f", 0x0, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "ge", 0xd, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "gl", 0xb, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "gle", 0x9, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "gt", 0xf, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "le", 0xe, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "lt", 0xc, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "neq", 0x2, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "nge", 0xd, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "ngl", 0xb, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "ngle",0x9, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "ngt", 0xf, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "nle", 0xe, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "nlt", 0xc, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "oge", 0x5, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "ogl", 0x3, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "ogt", 0x7, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "ole", 0x6, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "olt", 0x4, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "or", 0x1, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "seq", 0xa, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "sf", 0x8, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "sne", 0xa, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "st", 0x8, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "t", 0x0, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "ueq", 0x3, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "uge", 0x4, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "ugt", 0x6, PROCESSOR_V850E2V3_UP }, /* false. */
|
|
|
|
|
{ "ule", 0x7, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "ult", 0x5, PROCESSOR_V850E2V3_UP }, /* true. */
|
|
|
|
|
{ "un", 0x1, PROCESSOR_V850E2V3_UP }, /* true. */
|
2010-07-23 22:52:54 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define FLOAT_CC_NAME_CNT \
|
|
|
|
|
(sizeof (float_cc_names) / sizeof (struct reg_name))
|
|
|
|
|
|
2013-01-24 19:14:05 +08:00
|
|
|
|
|
|
|
|
|
static const struct reg_name cacheop_names[] =
|
|
|
|
|
{
|
|
|
|
|
{ "cfald", 0x44, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "cfali", 0x40, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "chbid", 0x04, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "chbii", 0x00, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "chbiwbd", 0x06, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "chbwbd", 0x07, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "cibid", 0x24, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "cibii", 0x20, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "cibiwbd", 0x26, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "cibwbd", 0x27, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "cildd", 0x65, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "cildi", 0x61, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "cistd", 0x64, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "cisti", 0x60, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define CACHEOP_NAME_CNT \
|
|
|
|
|
(sizeof (cacheop_names) / sizeof (struct reg_name))
|
|
|
|
|
|
|
|
|
|
static const struct reg_name prefop_names[] =
|
|
|
|
|
{
|
|
|
|
|
{ "prefd", 0x04, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "prefi", 0x00, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define PREFOP_NAME_CNT \
|
|
|
|
|
(sizeof (prefop_names) / sizeof (struct reg_name))
|
|
|
|
|
|
|
|
|
|
static const struct reg_name vector_registers[] =
|
|
|
|
|
{
|
|
|
|
|
{ "vr0", 0, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr1", 1, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr10", 10, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr11", 11, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr12", 12, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr13", 13, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr14", 14, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr15", 15, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr16", 16, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr17", 17, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr18", 18, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr19", 19, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr2", 2, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr20", 20, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr21", 21, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr22", 22, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr23", 23, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr24", 24, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr25", 25, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr26", 26, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr27", 27, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr28", 28, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr29", 29, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr3", 3, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr30", 30, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr31", 31, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr4", 4, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr5", 5, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr6", 6, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr7", 7, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr8", 8, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
{ "vr9", 9, PROCESSOR_V850E3V5_UP },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define VREG_NAME_CNT \
|
|
|
|
|
(sizeof (vector_registers) / sizeof (struct reg_name))
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Do a binary search of the given register table to see if NAME is a
|
2017-01-23 23:23:07 +08:00
|
|
|
|
valid register name. Return the register number from the array on
|
2000-08-02 03:02:49 +08:00
|
|
|
|
success, or -1 on failure. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
static int
|
2005-03-25 04:40:28 +08:00
|
|
|
|
reg_name_search (const struct reg_name *regs,
|
|
|
|
|
int regcount,
|
|
|
|
|
const char *name,
|
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
|
|
|
|
bool accept_numbers)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
int middle, low, high;
|
|
|
|
|
int cmp;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
symbolS *symbolP;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
/* If the register name is a symbol, then evaluate it. */
|
|
|
|
|
if ((symbolP = symbol_find (name)) != NULL)
|
|
|
|
|
{
|
|
|
|
|
/* If the symbol is an alias for another name then use that.
|
|
|
|
|
If the symbol is an alias for a number, then return the number. */
|
1999-06-22 22:35:19 +08:00
|
|
|
|
if (symbol_equated_p (symbolP))
|
2005-03-25 04:40:28 +08:00
|
|
|
|
name
|
|
|
|
|
= S_GET_NAME (symbol_get_value_expression (symbolP)->X_add_symbol);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else if (accept_numbers)
|
|
|
|
|
{
|
|
|
|
|
int reg = S_GET_VALUE (symbolP);
|
2010-07-23 22:52:54 +08:00
|
|
|
|
return reg;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Otherwise drop through and try parsing name normally. */
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
low = 0;
|
|
|
|
|
high = regcount - 1;
|
|
|
|
|
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
middle = (low + high) / 2;
|
|
|
|
|
cmp = strcasecmp (name, regs[middle].name);
|
|
|
|
|
if (cmp < 0)
|
|
|
|
|
high = middle - 1;
|
|
|
|
|
else if (cmp > 0)
|
|
|
|
|
low = middle + 1;
|
|
|
|
|
else
|
2010-07-23 22:52:54 +08:00
|
|
|
|
return ((regs[middle].processors & processor_mask)
|
|
|
|
|
? regs[middle].value
|
|
|
|
|
: -1);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
while (low <= high);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Summary of register_name().
|
2003-07-15 12:04:18 +08:00
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
in: Input_line_pointer points to 1st char of operand.
|
2003-07-15 12:04:18 +08:00
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
out: An expressionS.
|
|
|
|
|
The operand may have been a register: in this case, X_op == O_register,
|
|
|
|
|
X_add_number is set to the register number, and truth is returned.
|
|
|
|
|
Input_line_pointer->(next non-blank) char after operand, or is in
|
|
|
|
|
its original state. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
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
|
|
|
|
static bool
|
2005-03-25 04:40:28 +08:00
|
|
|
|
register_name (expressionS *expressionP)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int reg_number;
|
|
|
|
|
char *name;
|
|
|
|
|
char *start;
|
|
|
|
|
char c;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Find the spelling of the operand. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
start = input_line_pointer;
|
|
|
|
|
c = get_symbol_name (&name);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT,
|
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
|
|
|
|
name, false);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Put back the delimiting char. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
expressionP->X_add_symbol = NULL;
|
|
|
|
|
expressionP->X_op_symbol = NULL;
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Look to see if it's in the register table. */
|
|
|
|
|
if (reg_number >= 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2003-07-15 12:04:18 +08:00
|
|
|
|
expressionP->X_op = O_register;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
expressionP->X_add_number = reg_number;
|
|
|
|
|
|
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
|
|
|
|
return true;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* Reset the line as if we had not done anything. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
expressionP->X_op = O_illegal;
|
|
|
|
|
|
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
|
|
|
|
return false;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Summary of system_register_name().
|
2003-07-15 12:04:18 +08:00
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
in: INPUT_LINE_POINTER points to 1st char of operand.
|
2003-07-15 12:04:18 +08:00
|
|
|
|
EXPRESSIONP points to an expression structure to be filled in.
|
|
|
|
|
ACCEPT_NUMBERS is true iff numerical register names may be used.
|
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
out: An expressionS structure in expressionP.
|
|
|
|
|
The operand may have been a register: in this case, X_op == O_register,
|
|
|
|
|
X_add_number is set to the register number, and truth is returned.
|
|
|
|
|
Input_line_pointer->(next non-blank) char after operand, or is in
|
|
|
|
|
its original state. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
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
|
|
|
|
static bool
|
2005-03-25 04:40:28 +08:00
|
|
|
|
system_register_name (expressionS *expressionP,
|
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
|
|
|
|
bool accept_numbers)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int reg_number;
|
|
|
|
|
char *name;
|
|
|
|
|
char *start;
|
|
|
|
|
char c;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Find the spelling of the operand. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
start = input_line_pointer;
|
|
|
|
|
c = get_symbol_name (&name);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
reg_number = reg_name_search (system_registers, SYSREG_NAME_CNT, name,
|
|
|
|
|
accept_numbers);
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Put back the delimiting char. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (reg_number < 0
|
|
|
|
|
&& accept_numbers)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Reset input_line pointer. */
|
|
|
|
|
input_line_pointer = start;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2001-09-19 13:33:36 +08:00
|
|
|
|
if (ISDIGIT (*input_line_pointer))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
reg_number = strtol (input_line_pointer, &input_line_pointer, 0);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
expressionP->X_add_symbol = NULL;
|
|
|
|
|
expressionP->X_op_symbol = NULL;
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Look to see if it's in the register table. */
|
|
|
|
|
if (reg_number >= 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2003-07-15 12:04:18 +08:00
|
|
|
|
expressionP->X_op = O_register;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
expressionP->X_add_number = reg_number;
|
|
|
|
|
|
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
|
|
|
|
return true;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* Reset the line as if we had not done anything. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
expressionP->X_op = O_illegal;
|
|
|
|
|
|
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
|
|
|
|
return false;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Summary of cc_name().
|
2003-07-15 12:04:18 +08:00
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
in: INPUT_LINE_POINTER points to 1st char of operand.
|
2003-07-15 12:04:18 +08:00
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
out: An expressionS.
|
|
|
|
|
The operand may have been a register: in this case, X_op == O_register,
|
|
|
|
|
X_add_number is set to the register number, and truth is returned.
|
|
|
|
|
Input_line_pointer->(next non-blank) char after operand, or is in
|
|
|
|
|
its original state. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
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
|
|
|
|
static bool
|
2010-07-23 22:52:54 +08:00
|
|
|
|
cc_name (expressionS *expressionP,
|
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
|
|
|
|
bool accept_numbers)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int reg_number;
|
|
|
|
|
char *name;
|
|
|
|
|
char *start;
|
|
|
|
|
char c;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Find the spelling of the operand. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
start = input_line_pointer;
|
|
|
|
|
c = get_symbol_name (&name);
|
2010-07-23 22:52:54 +08:00
|
|
|
|
reg_number = reg_name_search (cc_names, CC_NAME_CNT, name, accept_numbers);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Put back the delimiting char. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (reg_number < 0
|
|
|
|
|
&& accept_numbers)
|
|
|
|
|
{
|
|
|
|
|
/* Reset input_line pointer. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
if (ISDIGIT (*input_line_pointer))
|
|
|
|
|
{
|
|
|
|
|
reg_number = strtol (input_line_pointer, &input_line_pointer, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expressionP->X_add_symbol = NULL;
|
|
|
|
|
expressionP->X_op_symbol = NULL;
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Look to see if it's in the register table. */
|
|
|
|
|
if (reg_number >= 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2003-07-15 12:04:18 +08:00
|
|
|
|
expressionP->X_op = O_constant;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
expressionP->X_add_number = reg_number;
|
|
|
|
|
|
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
|
|
|
|
return true;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
/* Reset the line as if we had not done anything. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
expressionP->X_op = O_illegal;
|
|
|
|
|
expressionP->X_add_number = 0;
|
|
|
|
|
|
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
|
|
|
|
return false;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
static bool
|
2010-07-23 22:52:54 +08:00
|
|
|
|
float_cc_name (expressionS *expressionP,
|
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
|
|
|
|
bool accept_numbers)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
int reg_number;
|
|
|
|
|
char *name;
|
|
|
|
|
char *start;
|
|
|
|
|
char c;
|
|
|
|
|
|
|
|
|
|
/* Find the spelling of the operand. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
start = input_line_pointer;
|
|
|
|
|
c = get_symbol_name (&name);
|
2010-07-23 22:52:54 +08:00
|
|
|
|
reg_number = reg_name_search (float_cc_names, FLOAT_CC_NAME_CNT, name, accept_numbers);
|
|
|
|
|
|
|
|
|
|
/* Put back the delimiting char. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
if (reg_number < 0
|
|
|
|
|
&& accept_numbers)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* Reset input_line pointer. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
input_line_pointer = start;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (ISDIGIT (*input_line_pointer))
|
|
|
|
|
{
|
|
|
|
|
reg_number = strtol (input_line_pointer, &input_line_pointer, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expressionP->X_add_symbol = NULL;
|
|
|
|
|
expressionP->X_op_symbol = NULL;
|
|
|
|
|
|
|
|
|
|
/* Look to see if it's in the register table. */
|
|
|
|
|
if (reg_number >= 0)
|
|
|
|
|
{
|
|
|
|
|
expressionP->X_op = O_constant;
|
|
|
|
|
expressionP->X_add_number = reg_number;
|
|
|
|
|
|
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
|
|
|
|
return true;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
/* Reset the line as if we had not done anything. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
expressionP->X_op = O_illegal;
|
|
|
|
|
expressionP->X_add_number = 0;
|
|
|
|
|
|
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
|
|
|
|
return false;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
static bool
|
2013-01-24 19:14:05 +08:00
|
|
|
|
cacheop_name (expressionS * expressionP,
|
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
|
|
|
|
bool accept_numbers)
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{
|
|
|
|
|
int reg_number;
|
|
|
|
|
char *name;
|
|
|
|
|
char *start;
|
|
|
|
|
char c;
|
|
|
|
|
|
|
|
|
|
/* Find the spelling of the operand. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
start = input_line_pointer;
|
|
|
|
|
c = get_symbol_name (&name);
|
2013-01-24 19:14:05 +08:00
|
|
|
|
reg_number = reg_name_search (cacheop_names, CACHEOP_NAME_CNT, name, accept_numbers);
|
|
|
|
|
|
|
|
|
|
/* Put back the delimiting char. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
2013-01-24 19:14:05 +08:00
|
|
|
|
|
|
|
|
|
if (reg_number < 0
|
|
|
|
|
&& accept_numbers)
|
|
|
|
|
{
|
|
|
|
|
/* Reset input_line pointer. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
if (ISDIGIT (*input_line_pointer))
|
|
|
|
|
reg_number = strtol (input_line_pointer, &input_line_pointer, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expressionP->X_add_symbol = NULL;
|
|
|
|
|
expressionP->X_op_symbol = NULL;
|
|
|
|
|
|
|
|
|
|
/* Look to see if it's in the register table. */
|
|
|
|
|
if (reg_number >= 0)
|
|
|
|
|
{
|
|
|
|
|
expressionP->X_op = O_constant;
|
|
|
|
|
expressionP->X_add_number = reg_number;
|
|
|
|
|
|
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
|
|
|
|
return true;
|
2013-01-24 19:14:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Reset the line as if we had not done anything. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
expressionP->X_op = O_illegal;
|
|
|
|
|
expressionP->X_add_number = 0;
|
|
|
|
|
|
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
|
|
|
|
return false;
|
2013-01-24 19:14:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
static bool
|
2013-01-24 19:14:05 +08:00
|
|
|
|
prefop_name (expressionS * expressionP,
|
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
|
|
|
|
bool accept_numbers)
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{
|
|
|
|
|
int reg_number;
|
|
|
|
|
char *name;
|
|
|
|
|
char *start;
|
|
|
|
|
char c;
|
|
|
|
|
|
|
|
|
|
/* Find the spelling of the operand. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
start = input_line_pointer;
|
|
|
|
|
c = get_symbol_name (&name);
|
2013-01-24 19:14:05 +08:00
|
|
|
|
reg_number = reg_name_search (prefop_names, PREFOP_NAME_CNT, name, accept_numbers);
|
|
|
|
|
|
|
|
|
|
/* Put back the delimiting char. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
2013-01-24 19:14:05 +08:00
|
|
|
|
|
|
|
|
|
if (reg_number < 0
|
|
|
|
|
&& accept_numbers)
|
|
|
|
|
{
|
|
|
|
|
/* Reset input_line pointer. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
if (ISDIGIT (*input_line_pointer))
|
|
|
|
|
reg_number = strtol (input_line_pointer, &input_line_pointer, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expressionP->X_add_symbol = NULL;
|
|
|
|
|
expressionP->X_op_symbol = NULL;
|
|
|
|
|
|
|
|
|
|
/* Look to see if it's in the register table. */
|
|
|
|
|
if (reg_number >= 0)
|
|
|
|
|
{
|
|
|
|
|
expressionP->X_op = O_constant;
|
|
|
|
|
expressionP->X_add_number = reg_number;
|
|
|
|
|
|
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
|
|
|
|
return true;
|
2013-01-24 19:14:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Reset the line as if we had not done anything. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
expressionP->X_op = O_illegal;
|
|
|
|
|
expressionP->X_add_number = 0;
|
|
|
|
|
|
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
|
|
|
|
return false;
|
2013-01-24 19:14:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
static bool
|
2013-01-24 19:14:05 +08:00
|
|
|
|
vector_register_name (expressionS *expressionP)
|
|
|
|
|
{
|
|
|
|
|
int reg_number;
|
|
|
|
|
char *name;
|
|
|
|
|
char *start;
|
|
|
|
|
char c;
|
|
|
|
|
|
|
|
|
|
/* Find the spelling of the operand. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
start = input_line_pointer;
|
|
|
|
|
c = get_symbol_name (&name);
|
2013-01-24 19:14:05 +08:00
|
|
|
|
|
|
|
|
|
reg_number = reg_name_search (vector_registers, VREG_NAME_CNT,
|
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
|
|
|
|
name, false);
|
2013-01-24 19:14:05 +08:00
|
|
|
|
|
|
|
|
|
/* Put back the delimiting char. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
2013-01-24 19:14:05 +08:00
|
|
|
|
|
|
|
|
|
expressionP->X_add_symbol = NULL;
|
|
|
|
|
expressionP->X_op_symbol = NULL;
|
|
|
|
|
|
|
|
|
|
/* Look to see if it's in the register table. */
|
|
|
|
|
if (reg_number >= 0)
|
|
|
|
|
{
|
|
|
|
|
expressionP->X_op = O_register;
|
|
|
|
|
expressionP->X_add_number = reg_number;
|
|
|
|
|
|
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
|
|
|
|
return true;
|
2013-01-24 19:14:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Reset the line as if we had not done anything. */
|
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
|
|
|
|
|
expressionP->X_op = O_illegal;
|
|
|
|
|
|
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
|
|
|
|
return false;
|
2013-01-24 19:14:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
static void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
skip_white_space (void)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
while (*input_line_pointer == ' '
|
|
|
|
|
|| *input_line_pointer == '\t')
|
|
|
|
|
++input_line_pointer;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Summary of parse_register_list ().
|
2003-07-15 12:04:18 +08:00
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
in: INPUT_LINE_POINTER points to 1st char of a list of registers.
|
2003-07-15 12:04:18 +08:00
|
|
|
|
INSN is the partially constructed instruction.
|
|
|
|
|
OPERAND is the operand being inserted.
|
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
out: NULL if the parse completed successfully, otherwise a
|
2003-07-15 12:04:18 +08:00
|
|
|
|
pointer to an error message is returned. If the parse
|
|
|
|
|
completes the correct bit fields in the instruction
|
|
|
|
|
will be filled in.
|
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
Parses register lists with the syntax:
|
2003-07-15 12:04:18 +08:00
|
|
|
|
|
2003-02-21 20:33:34 +08:00
|
|
|
|
{ rX }
|
|
|
|
|
{ rX, rY }
|
|
|
|
|
{ rX - rY }
|
|
|
|
|
{ rX - rY, rZ }
|
|
|
|
|
etc
|
2003-07-15 12:04:18 +08:00
|
|
|
|
|
2017-01-23 23:23:07 +08:00
|
|
|
|
and also parses constant expressions whose bits indicate the
|
2003-02-21 20:33:34 +08:00
|
|
|
|
registers in the lists. The LSB in the expression refers to
|
2003-11-22 23:32:28 +08:00
|
|
|
|
the lowest numbered permissible register in the register list,
|
2003-02-21 20:33:34 +08:00
|
|
|
|
and so on upwards. System registers are considered to be very
|
|
|
|
|
high numbers. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2016-04-01 20:07:50 +08:00
|
|
|
|
static const char *
|
2005-03-25 04:40:28 +08:00
|
|
|
|
parse_register_list (unsigned long *insn,
|
|
|
|
|
const struct v850_operand *operand)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2005-03-25 04:40:28 +08:00
|
|
|
|
static int type1_regs[32] =
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
0, 0, 0, 0, 0, 31, 29, 28, 23, 22, 21, 20, 27, 26, 25, 24
|
|
|
|
|
};
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int *regs;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
expressionS exp;
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Select a register array to parse. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
switch (operand->shift)
|
|
|
|
|
{
|
|
|
|
|
case 0xffe00001: regs = type1_regs; break;
|
|
|
|
|
default:
|
|
|
|
|
as_bad (_("unknown operand shift: %x\n"), operand->shift);
|
|
|
|
|
return _("internal failure in parse_register_list");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
skip_white_space ();
|
|
|
|
|
|
|
|
|
|
/* If the expression starts with a curly brace it is a register list.
|
2017-01-23 23:23:07 +08:00
|
|
|
|
Otherwise it is a constant expression, whose bits indicate which
|
1999-05-03 15:29:11 +08:00
|
|
|
|
registers are to be included in the list. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (*input_line_pointer != '{')
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
int reg;
|
|
|
|
|
int i;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
expression (&exp);
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (exp.X_op != O_constant)
|
|
|
|
|
return _("constant expression or register list expected");
|
|
|
|
|
|
|
|
|
|
if (regs == type1_regs)
|
|
|
|
|
{
|
|
|
|
|
if (exp.X_add_number & 0xFFFFF000)
|
|
|
|
|
return _("high bits set in register list expression");
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
for (reg = 20; reg < 32; reg++)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (exp.X_add_number & (1 << (reg - 20)))
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 32; i++)
|
|
|
|
|
if (regs[i] == reg)
|
2000-08-02 03:02:49 +08:00
|
|
|
|
*insn |= (1 << i);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
input_line_pointer++;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
/* Parse the register list until a terminator (closing curly brace or
|
|
|
|
|
new-line) is found. */
|
|
|
|
|
for (;;)
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
skip_white_space ();
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (register_name (&exp))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int i;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* Locate the given register in the list, and if it is there,
|
|
|
|
|
insert the corresponding bit into the instruction. */
|
|
|
|
|
for (i = 0; i < 32; i++)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (regs[i] == exp.X_add_number)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2020-08-31 15:51:06 +08:00
|
|
|
|
*insn |= 1u << i;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i == 32)
|
2003-02-21 20:33:34 +08:00
|
|
|
|
return _("illegal register included in list");
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
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
|
|
|
|
else if (system_register_name (&exp, true))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
if (regs == type1_regs)
|
|
|
|
|
{
|
|
|
|
|
return _("system registers cannot be included in list");
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
if (*input_line_pointer == '}')
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
input_line_pointer++;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
else if (*input_line_pointer == ',')
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
input_line_pointer++;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
continue;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
else if (*input_line_pointer == '-')
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* We have encountered a range of registers: rX - rY. */
|
|
|
|
|
int j;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
expressionS exp2;
|
|
|
|
|
|
|
|
|
|
/* Skip the dash. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
++input_line_pointer;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
/* Get the second register in the range. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (! register_name (&exp2))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
return _("second register should follow dash in register list");
|
2010-07-23 22:52:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (exp.X_add_number > exp2.X_add_number)
|
|
|
|
|
{
|
2011-05-13 07:50:23 +08:00
|
|
|
|
return _("second register should be greater than first register");
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Add the rest of the registers in the range. */
|
|
|
|
|
for (j = exp.X_add_number + 1; j <= exp2.X_add_number; j++)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int i;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* Locate the given register in the list, and if it is there,
|
|
|
|
|
insert the corresponding bit into the instruction. */
|
|
|
|
|
for (i = 0; i < 32; i++)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (regs[i] == j)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
*insn |= (1 << i);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i == 32)
|
|
|
|
|
return _("illegal register included in list");
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
exp = exp2;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
2003-02-21 20:33:34 +08:00
|
|
|
|
break;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-29 15:08:02 +08:00
|
|
|
|
const char md_shortopts[] = "m:";
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2024-10-29 15:08:02 +08:00
|
|
|
|
const struct option md_longopts[] =
|
2005-03-25 04:40:28 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
#define OPTION_DISP_SIZE_DEFAULT_22 (OPTION_MD_BASE)
|
|
|
|
|
{"disp-size-default-22", no_argument, NULL, OPTION_DISP_SIZE_DEFAULT_22},
|
|
|
|
|
#define OPTION_DISP_SIZE_DEFAULT_32 (OPTION_MD_BASE + 1)
|
|
|
|
|
{"disp-size-default-32", no_argument, NULL, OPTION_DISP_SIZE_DEFAULT_32},
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{NULL, no_argument, NULL, 0}
|
|
|
|
|
};
|
|
|
|
|
|
2024-10-29 15:08:02 +08:00
|
|
|
|
const size_t md_longopts_size = sizeof (md_longopts);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
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
|
|
|
|
static bool v850_data_8 = false;
|
2015-02-25 01:54:09 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
md_show_usage (FILE *stream)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
fprintf (stream, _(" V850 options:\n"));
|
|
|
|
|
fprintf (stream, _(" -mwarn-signed-overflow Warn if signed immediate values overflow\n"));
|
|
|
|
|
fprintf (stream, _(" -mwarn-unsigned-overflow Warn if unsigned immediate values overflow\n"));
|
|
|
|
|
fprintf (stream, _(" -mv850 The code is targeted at the v850\n"));
|
|
|
|
|
fprintf (stream, _(" -mv850e The code is targeted at the v850e\n"));
|
2003-09-04 19:04:38 +08:00
|
|
|
|
fprintf (stream, _(" -mv850e1 The code is targeted at the v850e1\n"));
|
2010-07-23 22:52:54 +08:00
|
|
|
|
fprintf (stream, _(" -mv850e2 The code is targeted at the v850e2\n"));
|
|
|
|
|
fprintf (stream, _(" -mv850e2v3 The code is targeted at the v850e2v3\n"));
|
2013-01-24 19:14:05 +08:00
|
|
|
|
fprintf (stream, _(" -mv850e2v4 Alias for -mv850e3v5\n"));
|
|
|
|
|
fprintf (stream, _(" -mv850e3v5 The code is targeted at the v850e3v5\n"));
|
2002-08-29 14:49:35 +08:00
|
|
|
|
fprintf (stream, _(" -mrelax Enable relaxation\n"));
|
2010-07-23 22:52:54 +08:00
|
|
|
|
fprintf (stream, _(" --disp-size-default-22 branch displacement with unknown size is 22 bits (default)\n"));
|
|
|
|
|
fprintf (stream, _(" --disp-size-default-32 branch displacement with unknown size is 32 bits\n"));
|
|
|
|
|
fprintf (stream, _(" -mextension enable extension opcode support\n"));
|
|
|
|
|
fprintf (stream, _(" -mno-bcond17 disable b<cond> disp17 instruction\n"));
|
|
|
|
|
fprintf (stream, _(" -mno-stld23 disable st/ld offset23 instruction\n"));
|
2012-11-10 01:36:19 +08:00
|
|
|
|
fprintf (stream, _(" -mgcc-abi Mark the binary as using the old GCC ABI\n"));
|
|
|
|
|
fprintf (stream, _(" -mrh850-abi Mark the binary as using the RH850 ABI (default)\n"));
|
|
|
|
|
fprintf (stream, _(" -m8byte-align Mark the binary as using 64-bit alignment\n"));
|
|
|
|
|
fprintf (stream, _(" -m4byte-align Mark the binary as using 32-bit alignment (default)\n"));
|
2015-02-25 01:54:09 +08:00
|
|
|
|
fprintf (stream, _(" -msoft-float Mark the binary as not using FP insns (default for pre e2v3)\n"));
|
|
|
|
|
fprintf (stream, _(" -mhard-float Mark the binary as using FP insns (default for e2v3 and up)\n"));
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2016-02-27 22:35:32 +08:00
|
|
|
|
md_parse_option (int c, const char *arg)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
if (c != 'm')
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
switch (c)
|
|
|
|
|
{
|
|
|
|
|
case OPTION_DISP_SIZE_DEFAULT_22:
|
|
|
|
|
default_disp_size = 22;
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
case OPTION_DISP_SIZE_DEFAULT_32:
|
|
|
|
|
default_disp_size = 32;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
if (strcmp (arg, "warn-signed-overflow") == 0)
|
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
|
|
|
|
warn_signed_overflows = true;
|
2004-08-17 20:19:58 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else if (strcmp (arg, "warn-unsigned-overflow") == 0)
|
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
|
|
|
|
warn_unsigned_overflows = true;
|
2004-08-17 20:19:58 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else if (strcmp (arg, "v850") == 0)
|
|
|
|
|
{
|
|
|
|
|
machine = 0;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
else if (strcmp (arg, "v850e") == 0)
|
|
|
|
|
{
|
|
|
|
|
machine = bfd_mach_v850e;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2003-09-04 19:04:38 +08:00
|
|
|
|
else if (strcmp (arg, "v850e1") == 0)
|
|
|
|
|
{
|
|
|
|
|
machine = bfd_mach_v850e1;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E1);
|
2003-09-04 19:04:38 +08:00
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
else if (strcmp (arg, "v850e2") == 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
machine = bfd_mach_v850e2;
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E2);
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (arg, "v850e2v3") == 0)
|
|
|
|
|
{
|
|
|
|
|
machine = bfd_mach_v850e2v3;
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E2V3);
|
|
|
|
|
}
|
2013-01-24 19:14:05 +08:00
|
|
|
|
else if (strcmp (arg, "v850e2v4") == 0)
|
|
|
|
|
{
|
|
|
|
|
machine = bfd_mach_v850e3v5;
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E3V5);
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (arg, "v850e3v5") == 0)
|
|
|
|
|
{
|
|
|
|
|
machine = bfd_mach_v850e3v5;
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E3V5);
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
else if (strcmp (arg, "extension") == 0)
|
|
|
|
|
{
|
2012-11-09 16:29:34 +08:00
|
|
|
|
processor_mask |= PROCESSOR_OPTION_EXTENSION | PROCESSOR_OPTION_ALIAS;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
}
|
|
|
|
|
else if (strcmp (arg, "no-bcond17") == 0)
|
|
|
|
|
{
|
|
|
|
|
no_bcond17 = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (arg, "no-stld23") == 0)
|
|
|
|
|
{
|
|
|
|
|
no_stld23 = 1;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2002-08-29 14:49:35 +08:00
|
|
|
|
else if (strcmp (arg, "relax") == 0)
|
|
|
|
|
v850_relax = 1;
|
2012-11-10 01:36:19 +08:00
|
|
|
|
else if (strcmp (arg, "gcc-abi") == 0)
|
|
|
|
|
{
|
|
|
|
|
v850_target_arch = bfd_arch_v850;
|
|
|
|
|
v850_target_format = "elf32-v850";
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (arg, "rh850-abi") == 0)
|
|
|
|
|
{
|
|
|
|
|
v850_target_arch = bfd_arch_v850_rh850;
|
|
|
|
|
v850_target_format = "elf32-v850-rh850";
|
|
|
|
|
}
|
2015-02-25 01:54:09 +08:00
|
|
|
|
else if (strcmp (arg, "8byte-align") == 0)
|
2015-03-05 21:04:33 +08:00
|
|
|
|
{
|
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
|
|
|
|
v850_data_8 = true;
|
2015-03-05 21:04:33 +08:00
|
|
|
|
v850_e_flags |= EF_RH850_DATA_ALIGN8;
|
|
|
|
|
}
|
2015-02-25 01:54:09 +08:00
|
|
|
|
else if (strcmp (arg, "4byte-align") == 0)
|
2015-03-05 21:04:33 +08:00
|
|
|
|
{
|
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
|
|
|
|
v850_data_8 = false;
|
2015-03-05 21:04:33 +08:00
|
|
|
|
v850_e_flags &= ~ EF_RH850_DATA_ALIGN8;
|
|
|
|
|
}
|
2015-02-25 01:54:09 +08:00
|
|
|
|
else if (strcmp (arg, "soft-float") == 0)
|
|
|
|
|
soft_float = 1;
|
|
|
|
|
else if (strcmp (arg, "hard-float") == 0)
|
|
|
|
|
soft_float = 0;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
2004-08-17 20:19:58 +08:00
|
|
|
|
return 0;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
symbolS *
|
2005-03-25 04:40:28 +08:00
|
|
|
|
md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-01 20:07:50 +08:00
|
|
|
|
const char *
|
2005-03-25 04:40:28 +08:00
|
|
|
|
md_atof (int type, char *litp, int *sizep)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
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
|
|
|
|
return ieee_md_atof (type, litp, sizep, false);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Very gross. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
|
|
|
|
|
asection *sec,
|
|
|
|
|
fragS *fragP)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2006-01-12 01:39:50 +08:00
|
|
|
|
union u
|
|
|
|
|
{
|
|
|
|
|
bfd_reloc_code_real_type fx_r_type;
|
|
|
|
|
char * fr_opcode;
|
|
|
|
|
}
|
|
|
|
|
opcode_converter;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
subseg_change (sec, 0);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2006-01-12 01:39:50 +08:00
|
|
|
|
opcode_converter.fr_opcode = fragP->fr_opcode;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
subseg_change (sec, 0);
|
|
|
|
|
|
2013-01-24 19:14:05 +08:00
|
|
|
|
if (fragP->fr_subtype == SUBYPTE_LOOP_16_22)
|
|
|
|
|
{
|
|
|
|
|
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
|
|
|
|
|
fragP->fr_offset, 1,
|
|
|
|
|
BFD_RELOC_UNUSED + opcode_converter.fx_r_type);
|
|
|
|
|
fragP->fr_fix += 4;
|
|
|
|
|
}
|
|
|
|
|
else if (fragP->fr_subtype == SUBYPTE_LOOP_16_22 + 1)
|
|
|
|
|
{
|
|
|
|
|
unsigned char * buffer =
|
2020-05-26 21:56:18 +08:00
|
|
|
|
(unsigned char *) (fragP->fr_fix + &fragP->fr_literal[0]);
|
2013-01-24 19:14:05 +08:00
|
|
|
|
int loop_reg = (buffer[0] & 0x1f);
|
|
|
|
|
|
|
|
|
|
/* Add -1.reg. */
|
|
|
|
|
md_number_to_chars ((char *) buffer, 0x025f | (loop_reg << 11), 2);
|
|
|
|
|
/* Now create the conditional branch + fixup to the final target. */
|
|
|
|
|
/* 0x000107ea = bne LBL(disp17). */
|
|
|
|
|
md_number_to_chars ((char *) buffer + 2, 0x000107ea, 4);
|
2021-09-02 19:16:10 +08:00
|
|
|
|
fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol,
|
2013-01-24 19:14:05 +08:00
|
|
|
|
fragP->fr_offset, 1,
|
|
|
|
|
BFD_RELOC_V850_17_PCREL);
|
|
|
|
|
fragP->fr_fix += 6;
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* In range conditional or unconditional branch. */
|
2013-01-24 19:14:05 +08:00
|
|
|
|
else if (fragP->fr_subtype == SUBYPTE_COND_9_22
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_UNCOND_9_22
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_COND_9_22_32
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_UNCOND_9_22_32
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_COND_9_17_22
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_COND_9_17_22_32
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_22
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_22_32
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_17_22
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_17_22_32)
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol,
|
2006-01-12 01:39:50 +08:00
|
|
|
|
fragP->fr_offset, 1,
|
|
|
|
|
BFD_RELOC_UNUSED + opcode_converter.fx_r_type);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
fragP->fr_fix += 2;
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* V850e2r-v3 17bit conditional branch. */
|
|
|
|
|
else if (fragP->fr_subtype == SUBYPTE_COND_9_17_22 + 1
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_COND_9_17_22_32 + 1
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_17_22 + 1
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_17_22_32 + 1)
|
|
|
|
|
{
|
|
|
|
|
unsigned char *buffer =
|
2020-05-26 21:56:18 +08:00
|
|
|
|
(unsigned char *) (fragP->fr_fix + &fragP->fr_literal[0]);
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
buffer[0] &= 0x0f; /* Use condition. */
|
|
|
|
|
buffer[0] |= 0xe0;
|
|
|
|
|
buffer[1] = 0x07;
|
|
|
|
|
|
|
|
|
|
/* Now create the unconditional branch + fixup to the final
|
|
|
|
|
target. */
|
|
|
|
|
md_number_to_chars ((char *) buffer + 2, 0x0001, 2);
|
|
|
|
|
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
|
|
|
|
|
fragP->fr_offset, 1, BFD_RELOC_V850_17_PCREL);
|
|
|
|
|
fragP->fr_fix += 4;
|
|
|
|
|
}
|
|
|
|
|
/* Out of range conditional branch. Emit a branch around a 22bit jump. */
|
|
|
|
|
else if (fragP->fr_subtype == SUBYPTE_COND_9_22 + 1
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_COND_9_22_32 + 1
|
2015-08-12 19:40:42 +08:00
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_COND_9_17_22 + 2
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_COND_9_17_22_32 + 2)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
unsigned char *buffer =
|
1999-05-03 15:29:11 +08:00
|
|
|
|
(unsigned char *) (fragP->fr_fix + fragP->fr_literal);
|
|
|
|
|
|
|
|
|
|
/* Reverse the condition of the first branch. */
|
|
|
|
|
buffer[0] ^= 0x08;
|
|
|
|
|
/* Mask off all the displacement bits. */
|
|
|
|
|
buffer[0] &= 0x8f;
|
|
|
|
|
buffer[1] &= 0x07;
|
|
|
|
|
/* Now set the displacement bits so that we branch
|
|
|
|
|
around the unconditional branch. */
|
|
|
|
|
buffer[0] |= 0x30;
|
|
|
|
|
|
|
|
|
|
/* Now create the unconditional branch + fixup to the final
|
|
|
|
|
target. */
|
2005-02-23 20:28:06 +08:00
|
|
|
|
md_number_to_chars ((char *) buffer + 2, 0x00000780, 4);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol,
|
2010-07-23 22:52:54 +08:00
|
|
|
|
fragP->fr_offset, 1, BFD_RELOC_V850_22_PCREL);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
fragP->fr_fix += 6;
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* Out of range conditional branch. Emit a branch around a 32bit jump. */
|
|
|
|
|
else if (fragP->fr_subtype == SUBYPTE_COND_9_22_32 + 2
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_COND_9_17_22_32 + 3)
|
|
|
|
|
{
|
|
|
|
|
unsigned char *buffer =
|
|
|
|
|
(unsigned char *) (fragP->fr_fix + fragP->fr_literal);
|
|
|
|
|
|
|
|
|
|
/* Reverse the condition of the first branch. */
|
|
|
|
|
buffer[0] ^= 0x08;
|
|
|
|
|
/* Mask off all the displacement bits. */
|
|
|
|
|
buffer[0] &= 0x8f;
|
|
|
|
|
buffer[1] &= 0x07;
|
|
|
|
|
/* Now set the displacement bits so that we branch
|
|
|
|
|
around the unconditional branch. */
|
|
|
|
|
buffer[0] |= 0x40;
|
|
|
|
|
|
|
|
|
|
/* Now create the unconditional branch + fixup to the final
|
|
|
|
|
target. */
|
|
|
|
|
md_number_to_chars ((char *) buffer + 2, 0x02e0, 2);
|
|
|
|
|
fix_new (fragP, fragP->fr_fix + 4, 4, fragP->fr_symbol,
|
|
|
|
|
fragP->fr_offset + 2, 1, BFD_RELOC_V850_32_PCREL);
|
|
|
|
|
fragP->fr_fix += 8;
|
|
|
|
|
}
|
|
|
|
|
/* Out of range unconditional branch. Emit a 22bit jump. */
|
|
|
|
|
else if (fragP->fr_subtype == SUBYPTE_UNCOND_9_22 + 1
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_UNCOND_9_22_32 + 1)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
md_number_to_chars (fragP->fr_fix + fragP->fr_literal, 0x00000780, 4);
|
|
|
|
|
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
|
2010-07-23 22:52:54 +08:00
|
|
|
|
fragP->fr_offset, 1, BFD_RELOC_V850_22_PCREL);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
fragP->fr_fix += 4;
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* Out of range unconditional branch. Emit a 32bit jump. */
|
|
|
|
|
else if (fragP->fr_subtype == SUBYPTE_UNCOND_9_22_32 + 2)
|
|
|
|
|
{
|
|
|
|
|
md_number_to_chars (fragP->fr_fix + fragP->fr_literal, 0x02e0, 2);
|
|
|
|
|
fix_new (fragP, fragP->fr_fix + 4, 4, fragP->fr_symbol,
|
|
|
|
|
fragP->fr_offset + 2, 1, BFD_RELOC_V850_32_PCREL);
|
|
|
|
|
fragP->fr_fix += 6;
|
|
|
|
|
}
|
|
|
|
|
/* Out of range SA conditional branch. Emit a branch to a 22bit jump. */
|
|
|
|
|
else if (fragP->fr_subtype == SUBYPTE_SA_9_22 + 1
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_22_32 + 1
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_17_22 + 2
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_17_22_32 + 2)
|
|
|
|
|
{
|
|
|
|
|
unsigned char *buffer =
|
|
|
|
|
(unsigned char *) (fragP->fr_fix + fragP->fr_literal);
|
|
|
|
|
|
|
|
|
|
/* bsa .+4 */
|
|
|
|
|
buffer[0] &= 0x8f;
|
|
|
|
|
buffer[0] |= 0x20;
|
|
|
|
|
buffer[1] &= 0x07;
|
|
|
|
|
|
|
|
|
|
/* br .+6 */
|
|
|
|
|
md_number_to_chars ((char *) buffer + 2, 0x05b5, 2);
|
|
|
|
|
|
|
|
|
|
/* Now create the unconditional branch + fixup to the final
|
|
|
|
|
target. */
|
|
|
|
|
/* jr SYM */
|
|
|
|
|
md_number_to_chars ((char *) buffer + 4, 0x00000780, 4);
|
|
|
|
|
fix_new (fragP, fragP->fr_fix + 4, 4, fragP->fr_symbol,
|
|
|
|
|
fragP->fr_offset, 1,
|
|
|
|
|
BFD_RELOC_V850_22_PCREL);
|
|
|
|
|
fragP->fr_fix += 8;
|
|
|
|
|
}
|
|
|
|
|
/* Out of range SA conditional branch. Emit a branch around a 32bit jump. */
|
|
|
|
|
else if (fragP->fr_subtype == SUBYPTE_SA_9_22_32 + 2
|
|
|
|
|
|| fragP->fr_subtype == SUBYPTE_SA_9_17_22_32 + 3)
|
|
|
|
|
{
|
|
|
|
|
unsigned char *buffer =
|
|
|
|
|
(unsigned char *) (fragP->fr_fix + fragP->fr_literal);
|
|
|
|
|
|
|
|
|
|
/* bsa .+2 */
|
|
|
|
|
buffer[0] &= 0x8f;
|
|
|
|
|
buffer[0] |= 0x20;
|
|
|
|
|
buffer[1] &= 0x07;
|
|
|
|
|
|
|
|
|
|
/* br .+8 */
|
|
|
|
|
md_number_to_chars ((char *) buffer + 2, 0x05c5, 2);
|
|
|
|
|
|
|
|
|
|
/* Now create the unconditional branch + fixup to the final
|
|
|
|
|
target. */
|
|
|
|
|
/* jr SYM */
|
|
|
|
|
md_number_to_chars ((char *) buffer + 4, 0x02e0, 2);
|
|
|
|
|
fix_new (fragP, fragP->fr_fix + 6, 4, fragP->fr_symbol,
|
|
|
|
|
fragP->fr_offset + 2, 1, BFD_RELOC_V850_32_PCREL);
|
|
|
|
|
|
|
|
|
|
fragP->fr_fix += 10;
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
valueT
|
2005-03-25 04:40:28 +08:00
|
|
|
|
md_section_align (asection *seg, valueT addr)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
bfd_section_* macros
This large patch removes the unnecessary bfd parameter from various
bfd section macros and functions. The bfd is hardly ever used and if
needed for the bfd_set_section_* or bfd_rename_section functions can
be found via section->owner except for the com, und, abs, and ind
std_section special sections. Those sections shouldn't be modified
anyway.
The patch also removes various bfd_get_section_<field> macros,
replacing their use with bfd_section_<field>, and adds
bfd_set_section_lma. I've also fixed a minor bug in gas where
compressed section renaming was done directly rather than calling
bfd_rename_section. This would have broken bfd_get_section_by_name
and similar functions, but that hardly mattered at such a late stage
in gas processing.
bfd/
* bfd-in.h (bfd_get_section_name, bfd_get_section_vma),
(bfd_get_section_lma, bfd_get_section_alignment),
(bfd_get_section_size, bfd_get_section_flags),
(bfd_get_section_userdata): Delete.
(bfd_section_name, bfd_section_size, bfd_section_vma),
(bfd_section_lma, bfd_section_alignment): Lose bfd parameter.
(bfd_section_flags, bfd_section_userdata): New.
(bfd_is_com_section): Rename parameter.
* section.c (bfd_set_section_userdata, bfd_set_section_vma),
(bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section),
(bfd_set_section_size): Delete bfd parameter, rename section parameter.
(bfd_set_section_lma): New.
* bfd-in2.h: Regenerate.
* mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param,
update callers.
* aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h,
* elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c,
* elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c,
* elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c,
* elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c,
* elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c,
* elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c,
* elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c,
* elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
* elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
* elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c,
* elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
* elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c,
* elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c,
* mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c,
* peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c,
* xcofflink.c: Update throughout for bfd section macro and function
changes.
binutils/
* addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c,
* objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c,
* od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c,
* resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update
throughout for bfd section macro and function changes.
gas/
* as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c,
* read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c,
* config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c,
* config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c,
* config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
* config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c,
* config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c,
* config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c,
* config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c,
* config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c,
* config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c,
* config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c,
* config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c,
* config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c,
* config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c,
* config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c,
* config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c,
* config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c,
* config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c,
* config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c,
* config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c,
* config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c,
* config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for
bfd section macro and function changes.
* write.c (compress_debug): Use bfd_rename_section.
gdb/
* aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c,
* coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c,
* dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c,
* exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h,
* hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c,
* i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c,
* maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c,
* mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c,
* objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c,
* ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c,
* rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c,
* s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c,
* solib-spu.c, * solib-svr4.c, * solib-target.c,
* spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c,
* symmisc.c, * symtab.c, * target.c, * windows-nat.c,
* xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c,
* mi/mi-interp.c: Update throughout for bfd section macro and
function changes.
* gcore (gcore_create_callback): Use bfd_set_section_lma.
* spu-tdep.c (spu_overlay_new_objfile): Likewise.
gprof/
* corefile.c, * symtab.c: Update throughout for bfd section
macro and function changes.
ld/
* ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c,
* emultempl/aarch64elf.em, * emultempl/aix.em,
* emultempl/armcoff.em, * emultempl/armelf.em,
* emultempl/cr16elf.em, * emultempl/cskyelf.em,
* emultempl/m68hc1xelf.em, * emultempl/m68kelf.em,
* emultempl/mipself.em, * emultempl/mmix-elfnmmo.em,
* emultempl/mmo.em, * emultempl/msp430.em,
* emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em,
* emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update
throughout for bfd section macro and function changes.
libctf/
* ctf-open-bfd.c: Update throughout for bfd section macro changes.
opcodes/
* arc-ext.c: Update throughout for bfd section macro changes.
sim/
* common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c,
* erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c,
* m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c,
* rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c,
* rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 18:55:17 +08:00
|
|
|
|
int align = bfd_section_alignment (seg);
|
2015-11-10 00:12:57 +08:00
|
|
|
|
return ((addr + (1 << align) - 1) & -(1 << align));
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
md_begin (void)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2016-02-26 00:55:21 +08:00
|
|
|
|
const char *prev_name = "";
|
2002-08-29 14:49:35 +08:00
|
|
|
|
const struct v850_opcode *op;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if (startswith (TARGET_CPU, "v850e3v5"))
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{
|
|
|
|
|
if (machine == -1)
|
|
|
|
|
machine = bfd_mach_v850e3v5;
|
|
|
|
|
|
|
|
|
|
if (!processor_mask)
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E3V5);
|
|
|
|
|
}
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (TARGET_CPU, "v850e2v4"))
|
2013-01-24 19:14:05 +08:00
|
|
|
|
{
|
|
|
|
|
if (machine == -1)
|
|
|
|
|
machine = bfd_mach_v850e3v5;
|
|
|
|
|
|
|
|
|
|
if (!processor_mask)
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E3V5);
|
|
|
|
|
}
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (TARGET_CPU, "v850e2v3"))
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
if (machine == -1)
|
|
|
|
|
machine = bfd_mach_v850e2v3;
|
|
|
|
|
|
|
|
|
|
if (!processor_mask)
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E2V3);
|
|
|
|
|
}
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (TARGET_CPU, "v850e2"))
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
if (machine == -1)
|
|
|
|
|
machine = bfd_mach_v850e2;
|
|
|
|
|
|
|
|
|
|
if (!processor_mask)
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E2);
|
|
|
|
|
}
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (TARGET_CPU, "v850e1"))
|
2003-09-04 19:04:38 +08:00
|
|
|
|
{
|
|
|
|
|
if (machine == -1)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
machine = bfd_mach_v850e1;
|
2003-09-04 19:04:38 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (!processor_mask)
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E1);
|
2003-09-04 19:04:38 +08:00
|
|
|
|
}
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (TARGET_CPU, "v850e"))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
if (machine == -1)
|
2000-08-02 03:02:49 +08:00
|
|
|
|
machine = bfd_mach_v850e;
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (!processor_mask)
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850E);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2021-03-22 20:33:04 +08:00
|
|
|
|
else if (startswith (TARGET_CPU, "v850"))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
if (machine == -1)
|
2000-08-02 03:02:49 +08:00
|
|
|
|
machine = 0;
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (!processor_mask)
|
|
|
|
|
SET_PROCESSOR_MASK (processor_mask, PROCESSOR_V850);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* xgettext:c-format */
|
|
|
|
|
as_bad (_("Unable to determine default target processor from string: %s"),
|
2003-07-15 12:04:18 +08:00
|
|
|
|
TARGET_CPU);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2015-02-25 01:54:09 +08:00
|
|
|
|
if (soft_float == -1)
|
|
|
|
|
soft_float = machine < bfd_mach_v850e2v3;
|
|
|
|
|
|
2020-08-18 16:57:21 +08:00
|
|
|
|
v850_hash = str_htab_create ();
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
/* Insert unique names into hash table. The V850 instruction set
|
|
|
|
|
has many identical opcode names that have different opcodes based
|
|
|
|
|
on the operands. This hash table then provides a quick index to
|
|
|
|
|
the first opcode with a particular name in the opcode table. */
|
|
|
|
|
op = v850_opcodes;
|
|
|
|
|
while (op->name)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (strcmp (prev_name, op->name))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
prev_name = (char *) op->name;
|
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 (v850_hash, op->name, op, 0);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
op++;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-10 01:36:19 +08:00
|
|
|
|
bfd_set_arch_mach (stdoutput, v850_target_arch, machine);
|
|
|
|
|
bfd_set_private_flags (stdoutput, v850_e_flags);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
2004-12-17 00:56:04 +08:00
|
|
|
|
static bfd_reloc_code_real_type
|
2010-07-23 22:52:54 +08:00
|
|
|
|
handle_hi016 (const struct v850_operand *operand, const char **errmsg)
|
2004-12-17 00:56:04 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand == NULL)
|
|
|
|
|
return BFD_RELOC_HI16;
|
2004-12-17 00:56:04 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_HI16)
|
|
|
|
|
return BFD_RELOC_HI16;
|
|
|
|
|
|
|
|
|
|
if (operand->default_reloc == BFD_RELOC_HI16_S)
|
|
|
|
|
return BFD_RELOC_HI16;
|
|
|
|
|
|
|
|
|
|
if (operand->default_reloc == BFD_RELOC_16)
|
|
|
|
|
return BFD_RELOC_HI16;
|
|
|
|
|
|
|
|
|
|
*errmsg = _("hi0() relocation used on an instruction which does "
|
|
|
|
|
"not support it");
|
|
|
|
|
return BFD_RELOC_64; /* Used to indicate an error condition. */
|
2004-12-17 00:56:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
static bfd_reloc_code_real_type
|
2010-07-23 22:52:54 +08:00
|
|
|
|
handle_hi16 (const struct v850_operand *operand, const char **errmsg)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
if (operand == NULL)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
return BFD_RELOC_HI16_S;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_HI16_S)
|
|
|
|
|
return BFD_RELOC_HI16_S;
|
|
|
|
|
|
|
|
|
|
if (operand->default_reloc == BFD_RELOC_HI16)
|
|
|
|
|
return BFD_RELOC_HI16_S;
|
|
|
|
|
|
|
|
|
|
if (operand->default_reloc == BFD_RELOC_16)
|
|
|
|
|
return BFD_RELOC_HI16_S;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
*errmsg = _("hi() relocation used on an instruction which does "
|
|
|
|
|
"not support it");
|
|
|
|
|
return BFD_RELOC_64; /* Used to indicate an error condition. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bfd_reloc_code_real_type
|
2010-07-23 22:52:54 +08:00
|
|
|
|
handle_lo16 (const struct v850_operand *operand, const char **errmsg)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (operand == NULL)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
return BFD_RELOC_LO16;
|
2021-09-02 19:16:10 +08:00
|
|
|
|
|
|
|
|
|
switch (operand->default_reloc)
|
|
|
|
|
{
|
|
|
|
|
case BFD_RELOC_LO16: return BFD_RELOC_LO16;
|
|
|
|
|
case BFD_RELOC_V850_LO16_SPLIT_OFFSET: return BFD_RELOC_V850_LO16_SPLIT_OFFSET;
|
|
|
|
|
case BFD_RELOC_V850_16_SPLIT_OFFSET: return BFD_RELOC_V850_LO16_SPLIT_OFFSET;
|
|
|
|
|
case BFD_RELOC_V850_16_S1: return BFD_RELOC_V850_LO16_S1;
|
|
|
|
|
case BFD_RELOC_16: return BFD_RELOC_LO16;
|
|
|
|
|
default:
|
|
|
|
|
*errmsg = _("lo() relocation used on an instruction which does "
|
|
|
|
|
"not support it");
|
|
|
|
|
return BFD_RELOC_64; /* Used to indicate an error condition. */
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bfd_reloc_code_real_type
|
2010-07-23 22:52:54 +08:00
|
|
|
|
handle_ctoff (const struct v850_operand *operand, const char **errmsg)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2014-05-18 00:45:18 +08:00
|
|
|
|
if (v850_target_arch == bfd_arch_v850_rh850)
|
|
|
|
|
{
|
|
|
|
|
*errmsg = _("ctoff() is not supported by the rh850 ABI. Use -mgcc-abi instead");
|
|
|
|
|
return BFD_RELOC_64; /* Used to indicate an error condition. */
|
|
|
|
|
}
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (operand == NULL)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
return BFD_RELOC_V850_CALLT_16_16_OFFSET;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_V850_CALLT_6_7_OFFSET)
|
|
|
|
|
return operand->default_reloc;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_V850_16_S1)
|
|
|
|
|
return BFD_RELOC_V850_CALLT_15_16_OFFSET;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_16)
|
|
|
|
|
return BFD_RELOC_V850_CALLT_16_16_OFFSET;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
*errmsg = _("ctoff() relocation used on an instruction which does not support it");
|
|
|
|
|
return BFD_RELOC_64; /* Used to indicate an error condition. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bfd_reloc_code_real_type
|
2010-07-23 22:52:54 +08:00
|
|
|
|
handle_sdaoff (const struct v850_operand *operand, const char **errmsg)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (operand == NULL)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
return BFD_RELOC_V850_SDA_16_16_OFFSET;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_V850_16_SPLIT_OFFSET)
|
|
|
|
|
return BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_16)
|
|
|
|
|
return BFD_RELOC_V850_SDA_16_16_OFFSET;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_V850_16_S1)
|
|
|
|
|
return BFD_RELOC_V850_SDA_15_16_OFFSET;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
*errmsg = _("sdaoff() relocation used on an instruction which does not support it");
|
|
|
|
|
return BFD_RELOC_64; /* Used to indicate an error condition. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bfd_reloc_code_real_type
|
2010-07-23 22:52:54 +08:00
|
|
|
|
handle_zdaoff (const struct v850_operand *operand, const char **errmsg)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand == NULL)
|
|
|
|
|
return BFD_RELOC_V850_ZDA_16_16_OFFSET;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_V850_16_SPLIT_OFFSET)
|
|
|
|
|
return BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_16)
|
|
|
|
|
return BFD_RELOC_V850_ZDA_16_16_OFFSET;
|
|
|
|
|
|
|
|
|
|
if (operand->default_reloc == BFD_RELOC_V850_16_S1)
|
|
|
|
|
return BFD_RELOC_V850_ZDA_15_16_OFFSET;
|
|
|
|
|
|
|
|
|
|
*errmsg = _("zdaoff() relocation used on an instruction which does not support it");
|
|
|
|
|
return BFD_RELOC_64; /* Used to indicate an error condition. */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bfd_reloc_code_real_type
|
|
|
|
|
handle_tdaoff (const struct v850_operand *operand, const char **errmsg)
|
|
|
|
|
{
|
|
|
|
|
if (operand == NULL)
|
|
|
|
|
/* Data item, not an instruction. */
|
|
|
|
|
return BFD_RELOC_V850_TDA_16_16_OFFSET;
|
|
|
|
|
|
|
|
|
|
switch (operand->default_reloc)
|
|
|
|
|
{
|
|
|
|
|
/* sld.hu, operand: D5-4. */
|
|
|
|
|
case BFD_RELOC_V850_TDA_4_5_OFFSET:
|
|
|
|
|
/* sld.bu, operand: D4. */
|
|
|
|
|
case BFD_RELOC_V850_TDA_4_4_OFFSET:
|
|
|
|
|
/* sld.w/sst.w, operand: D8_6. */
|
|
|
|
|
case BFD_RELOC_V850_TDA_6_8_OFFSET:
|
|
|
|
|
/* sld.h/sst.h, operand: D8_7. */
|
|
|
|
|
case BFD_RELOC_V850_TDA_7_8_OFFSET:
|
|
|
|
|
/* sld.b/sst.b, operand: D7. */
|
|
|
|
|
case BFD_RELOC_V850_TDA_7_7_OFFSET:
|
|
|
|
|
return operand->default_reloc;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (operand->default_reloc == BFD_RELOC_16 && operand->shift == 16)
|
|
|
|
|
/* set1 & chums, operands: D16. */
|
|
|
|
|
return BFD_RELOC_V850_TDA_16_16_OFFSET;
|
|
|
|
|
|
|
|
|
|
*errmsg = _("tdaoff() relocation used on an instruction which does not support it");
|
|
|
|
|
/* Used to indicate an error condition. */
|
|
|
|
|
return BFD_RELOC_64;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Warning: The code in this function relies upon the definitions
|
|
|
|
|
in the v850_operands[] array (defined in opcodes/v850-opc.c)
|
|
|
|
|
matching the hard coded values contained herein. */
|
|
|
|
|
|
|
|
|
|
static bfd_reloc_code_real_type
|
|
|
|
|
v850_reloc_prefix (const struct v850_operand *operand, const char **errmsg)
|
|
|
|
|
{
|
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
|
|
|
|
bool paren_skipped = false;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
/* Skip leading opening parenthesis. */
|
|
|
|
|
if (*input_line_pointer == '(')
|
|
|
|
|
{
|
|
|
|
|
++input_line_pointer;
|
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
|
|
|
|
paren_skipped = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define CHECK_(name, reloc) \
|
2002-10-14 19:28:57 +08:00
|
|
|
|
if (strncmp (input_line_pointer, name "(", strlen (name) + 1) == 0) \
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{ \
|
|
|
|
|
input_line_pointer += strlen (name); \
|
|
|
|
|
return reloc; \
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2021-09-02 19:16:10 +08:00
|
|
|
|
CHECK_ ("hi0", handle_hi016 (operand, errmsg));
|
|
|
|
|
CHECK_ ("hi", handle_hi16 (operand, errmsg));
|
|
|
|
|
CHECK_ ("lo", handle_lo16 (operand, errmsg));
|
2010-07-23 22:52:54 +08:00
|
|
|
|
CHECK_ ("sdaoff", handle_sdaoff (operand, errmsg));
|
|
|
|
|
CHECK_ ("zdaoff", handle_zdaoff (operand, errmsg));
|
|
|
|
|
CHECK_ ("tdaoff", handle_tdaoff (operand, errmsg));
|
|
|
|
|
CHECK_ ("hilo", BFD_RELOC_32);
|
|
|
|
|
CHECK_ ("lo23", BFD_RELOC_V850_23);
|
2021-09-02 19:16:10 +08:00
|
|
|
|
CHECK_ ("ctoff", handle_ctoff (operand, errmsg));
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* Restore skipped parenthesis. */
|
|
|
|
|
if (paren_skipped)
|
2000-08-02 03:02:49 +08:00
|
|
|
|
--input_line_pointer;
|
|
|
|
|
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
return BFD_RELOC_NONE;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Insert an operand value into an instruction. */
|
|
|
|
|
|
|
|
|
|
static unsigned long
|
2005-03-25 04:40:28 +08:00
|
|
|
|
v850_insert_operand (unsigned long insn,
|
|
|
|
|
const struct v850_operand *operand,
|
|
|
|
|
offsetT val,
|
2010-07-23 22:52:54 +08:00
|
|
|
|
const char **errmsg)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
if (operand->insert)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
const char *message = NULL;
|
|
|
|
|
|
|
|
|
|
insn = operand->insert (insn, val, &message);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (message != NULL)
|
|
|
|
|
{
|
|
|
|
|
if ((operand->flags & V850_OPERAND_SIGNED)
|
|
|
|
|
&& ! warn_signed_overflows
|
2010-07-23 22:52:54 +08:00
|
|
|
|
&& v850_msg_is_out_of_range (message))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Skip warning... */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
else if ((operand->flags & V850_OPERAND_SIGNED) == 0
|
|
|
|
|
&& ! warn_unsigned_overflows
|
2010-07-23 22:52:54 +08:00
|
|
|
|
&& v850_msg_is_out_of_range (message))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Skip warning... */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (errmsg != NULL)
|
|
|
|
|
*errmsg = message;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
else if (operand->bits == -1
|
|
|
|
|
|| operand->flags & V850E_IMMEDIATE16
|
|
|
|
|
|| operand->flags & V850E_IMMEDIATE23
|
|
|
|
|
|| operand->flags & V850E_IMMEDIATE32)
|
|
|
|
|
{
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->bits < 32)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
long min, max;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
if ((operand->flags & V850_OPERAND_SIGNED) != 0)
|
|
|
|
|
{
|
|
|
|
|
if (! warn_signed_overflows)
|
|
|
|
|
max = (1 << operand->bits) - 1;
|
|
|
|
|
else
|
|
|
|
|
max = (1 << (operand->bits - 1)) - 1;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
min = -(1 << (operand->bits - 1));
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
max = (1 << operand->bits) - 1;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (! warn_unsigned_overflows)
|
2000-08-02 03:02:49 +08:00
|
|
|
|
min = -(1 << (operand->bits - 1));
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
|
|
|
|
min = 0;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-03-13 23:54:21 +08:00
|
|
|
|
/* Some people write constants with the sign extension done by
|
|
|
|
|
hand but only up to 32 bits. This shouldn't really be valid,
|
|
|
|
|
but, to permit this code to assemble on a 64-bit host, we
|
|
|
|
|
sign extend the 32-bit value to 64 bits if so doing makes the
|
|
|
|
|
value valid. */
|
|
|
|
|
if (val > max
|
|
|
|
|
&& (offsetT) (val - 0x80000000 - 0x80000000) >= min
|
|
|
|
|
&& (offsetT) (val - 0x80000000 - 0x80000000) <= max)
|
|
|
|
|
val = val - 0x80000000 - 0x80000000;
|
|
|
|
|
|
|
|
|
|
/* Similarly, people write expressions like ~(1<<15), and expect
|
|
|
|
|
this to be OK for a 32-bit unsigned value. */
|
|
|
|
|
else if (val < min
|
|
|
|
|
&& (offsetT) (val + 0x80000000 + 0x80000000) >= min
|
|
|
|
|
&& (offsetT) (val + 0x80000000 + 0x80000000) <= max)
|
|
|
|
|
val = val + 0x80000000 + 0x80000000;
|
|
|
|
|
|
|
|
|
|
else if (val < (offsetT) min || val > (offsetT) max)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2012-10-04 18:30:06 +08:00
|
|
|
|
static char buf [128];
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* Restore min and mix to expected values for decimal ranges. */
|
|
|
|
|
if ((operand->flags & V850_OPERAND_SIGNED)
|
|
|
|
|
&& ! warn_signed_overflows)
|
|
|
|
|
max = (1 << (operand->bits - 1)) - 1;
|
|
|
|
|
|
|
|
|
|
if (! (operand->flags & V850_OPERAND_SIGNED)
|
|
|
|
|
&& ! warn_unsigned_overflows)
|
|
|
|
|
min = 0;
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
sprintf (buf, _("operand out of range (%d is not between %d and %d)"),
|
|
|
|
|
(int) val, (int) min, (int) max);
|
|
|
|
|
*errmsg = buf;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
insn |= (((long) val & ((1 << operand->bits) - 1)) << operand->shift);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
insn |= (((long) val) << operand->shift);
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
static char copy_of_instruction[128];
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
md_assemble (char *str)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
char *s;
|
|
|
|
|
char *start_of_operands;
|
|
|
|
|
struct v850_opcode *opcode;
|
|
|
|
|
struct v850_opcode *next_opcode;
|
|
|
|
|
const unsigned char *opindex_ptr;
|
|
|
|
|
int next_opindex;
|
|
|
|
|
int relaxable = 0;
|
2017-07-12 19:17:02 +08:00
|
|
|
|
unsigned long insn = 0;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
unsigned long insn_size;
|
2012-11-10 01:36:19 +08:00
|
|
|
|
char *f = NULL;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int i;
|
|
|
|
|
int match;
|
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
|
|
|
|
bool extra_data_after_insn = false;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
unsigned extra_data_len = 0;
|
|
|
|
|
unsigned long extra_data = 0;
|
|
|
|
|
char *saved_input_line_pointer;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
char most_match_errmsg[1024];
|
|
|
|
|
int most_match_count = -1;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
strncpy (copy_of_instruction, str, sizeof (copy_of_instruction) - 1);
|
2010-07-23 22:52:54 +08:00
|
|
|
|
most_match_errmsg[0] = 0;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* Get the opcode. */
|
2001-09-19 13:33:36 +08:00
|
|
|
|
for (s = str; *s != '\0' && ! ISSPACE (*s); s++)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
continue;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (*s != '\0')
|
|
|
|
|
*s++ = '\0';
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Find the first opcode with the proper name. */
|
2020-08-18 16:57:21 +08:00
|
|
|
|
opcode = (struct v850_opcode *) str_hash_find (v850_hash, str);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (opcode == NULL)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* xgettext:c-format */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
as_bad (_("Unrecognized opcode: `%s'"), str);
|
|
|
|
|
ignore_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
str = s;
|
2001-09-19 13:33:36 +08:00
|
|
|
|
while (ISSPACE (*str))
|
2000-08-02 03:02:49 +08:00
|
|
|
|
++str;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
start_of_operands = str;
|
|
|
|
|
|
|
|
|
|
saved_input_line_pointer = input_line_pointer;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
for (;;)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
const char *errmsg = NULL;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
const char *warningmsg = NULL;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
match = 0;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
opindex_ptr = opcode->operands;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (no_stld23)
|
|
|
|
|
{
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if ((startswith (opcode->name, "st.")
|
2010-07-23 22:52:54 +08:00
|
|
|
|
&& v850_operands[opcode->operands[1]].bits == 23)
|
2021-03-22 20:33:04 +08:00
|
|
|
|
|| (startswith (opcode->name, "ld.")
|
2010-07-23 22:52:54 +08:00
|
|
|
|
&& v850_operands[opcode->operands[0]].bits == 23))
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("st/ld offset 23 instruction was disabled .");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((opcode->processors & processor_mask & PROCESSOR_MASK) == 0
|
|
|
|
|
|| (((opcode->processors & ~PROCESSOR_MASK) != 0)
|
|
|
|
|
&& ((opcode->processors & processor_mask & ~PROCESSOR_MASK) == 0)))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("Target processor does not support this instruction.");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
relaxable = 0;
|
|
|
|
|
fc = 0;
|
|
|
|
|
next_opindex = 0;
|
|
|
|
|
insn = opcode->opcode;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 0;
|
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
|
|
|
|
extra_data_after_insn = false;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
input_line_pointer = str = start_of_operands;
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
for (opindex_ptr = opcode->operands; *opindex_ptr != 0; opindex_ptr++)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
const struct v850_operand *operand;
|
|
|
|
|
char *hold;
|
|
|
|
|
expressionS ex;
|
|
|
|
|
bfd_reloc_code_real_type reloc;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
if (next_opindex == 0)
|
2005-03-25 04:40:28 +08:00
|
|
|
|
operand = &v850_operands[*opindex_ptr];
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
operand = &v850_operands[next_opindex];
|
1999-05-03 15:29:11 +08:00
|
|
|
|
next_opindex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errmsg = NULL;
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
while (*str == ' ')
|
|
|
|
|
++str;
|
|
|
|
|
|
|
|
|
|
if (operand->flags & V850_OPERAND_BANG
|
|
|
|
|
&& *str == '!')
|
|
|
|
|
++str;
|
|
|
|
|
else if (operand->flags & V850_OPERAND_PERCENT
|
|
|
|
|
&& *str == '%')
|
|
|
|
|
++str;
|
|
|
|
|
|
|
|
|
|
if (*str == ',' || *str == '[' || *str == ']')
|
|
|
|
|
++str;
|
|
|
|
|
|
|
|
|
|
while (*str == ' ')
|
2000-08-02 03:02:49 +08:00
|
|
|
|
++str;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2013-01-24 19:14:05 +08:00
|
|
|
|
if ( (strcmp (opcode->name, "pushsp") == 0
|
|
|
|
|
|| strcmp (opcode->name, "popsp") == 0
|
|
|
|
|
|| strcmp (opcode->name, "dbpush") == 0)
|
|
|
|
|
&& (*str == '-'))
|
|
|
|
|
++str;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (operand->flags & V850_OPERAND_RELAX)
|
|
|
|
|
relaxable = 1;
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Gather the operand. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
hold = input_line_pointer;
|
|
|
|
|
input_line_pointer = str;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
/* lo(), hi(), hi0(), etc... */
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
if ((reloc = v850_reloc_prefix (operand, &errmsg)) != BFD_RELOC_NONE)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
/* This is a fake reloc, used to indicate an error condition. */
|
|
|
|
|
if (reloc == BFD_RELOC_64)
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* match = 1; */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
goto error;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
expression (&ex);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
if (ex.X_op == O_constant)
|
|
|
|
|
{
|
|
|
|
|
switch (reloc)
|
|
|
|
|
{
|
|
|
|
|
case BFD_RELOC_V850_ZDA_16_16_OFFSET:
|
2010-07-23 22:52:54 +08:00
|
|
|
|
case BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET:
|
|
|
|
|
case BFD_RELOC_V850_ZDA_15_16_OFFSET:
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* To cope with "not1 7, zdaoff(0xfffff006)[r0]"
|
|
|
|
|
and the like. */
|
|
|
|
|
/* Fall through. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
case BFD_RELOC_LO16:
|
2010-07-23 22:52:54 +08:00
|
|
|
|
case BFD_RELOC_V850_LO16_S1:
|
2004-12-17 00:56:04 +08:00
|
|
|
|
case BFD_RELOC_V850_LO16_SPLIT_OFFSET:
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
/* Truncate, then sign extend the value. */
|
|
|
|
|
ex.X_add_number = SEXT16 (ex.X_add_number);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_HI16:
|
|
|
|
|
{
|
|
|
|
|
/* Truncate, then sign extend the value. */
|
|
|
|
|
ex.X_add_number = SEXT16 (ex.X_add_number >> 16);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_HI16_S:
|
|
|
|
|
{
|
|
|
|
|
/* Truncate, then sign extend the value. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int temp = (ex.X_add_number >> 16) & 0xffff;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
temp += (ex.X_add_number >> 15) & 1;
|
|
|
|
|
|
|
|
|
|
ex.X_add_number = SEXT16 (temp);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
case BFD_RELOC_V850_23:
|
|
|
|
|
if ((operand->flags & V850E_IMMEDIATE23) == 0)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
case BFD_RELOC_32:
|
2010-07-23 22:52:54 +08:00
|
|
|
|
case BFD_RELOC_V850_32_ABS:
|
|
|
|
|
case BFD_RELOC_V850_32_PCREL:
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if ((operand->flags & V850E_IMMEDIATE32) == 0)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
default:
|
2013-01-24 19:14:05 +08:00
|
|
|
|
as_bad (_("AAARG -> unhandled constant reloc: %d"), reloc);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->flags & V850E_IMMEDIATE32)
|
|
|
|
|
{
|
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
|
|
|
|
extra_data_after_insn = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 4;
|
|
|
|
|
extra_data = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (operand->flags & V850E_IMMEDIATE23)
|
|
|
|
|
{
|
|
|
|
|
if (reloc != BFD_RELOC_V850_23)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
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
|
|
|
|
extra_data_after_insn = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 2;
|
|
|
|
|
extra_data = 0;
|
|
|
|
|
}
|
|
|
|
|
else if ((operand->flags & V850E_IMMEDIATE16)
|
|
|
|
|
|| (operand->flags & V850E_IMMEDIATE16HI))
|
|
|
|
|
{
|
|
|
|
|
if (operand->flags & V850E_IMMEDIATE16HI
|
|
|
|
|
&& reloc != BFD_RELOC_HI16
|
|
|
|
|
&& reloc != BFD_RELOC_HI16_S)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
else if (operand->flags & V850E_IMMEDIATE16
|
|
|
|
|
&& reloc != BFD_RELOC_LO16)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
extra_data_after_insn = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 2;
|
|
|
|
|
extra_data = 0;
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (fc > MAX_INSN_FIXUPS)
|
|
|
|
|
as_fatal (_("too many fixups"));
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
fixups[fc].exp = ex;
|
|
|
|
|
fixups[fc].opindex = *opindex_ptr;
|
|
|
|
|
fixups[fc].reloc = reloc;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
fc++;
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
else /* ex.X_op != O_constant. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if ((reloc == BFD_RELOC_32
|
|
|
|
|
|| reloc == BFD_RELOC_V850_32_ABS
|
|
|
|
|
|| reloc == BFD_RELOC_V850_32_PCREL)
|
|
|
|
|
&& operand->bits < 32)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
else if (reloc == BFD_RELOC_V850_23
|
|
|
|
|
&& (operand->flags & V850E_IMMEDIATE23) == 0)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
else if ((reloc == BFD_RELOC_HI16
|
|
|
|
|
|| reloc == BFD_RELOC_HI16_S)
|
|
|
|
|
&& operand->bits < 16)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (operand->flags & V850E_IMMEDIATE32)
|
|
|
|
|
{
|
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
|
|
|
|
extra_data_after_insn = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 4;
|
|
|
|
|
extra_data = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (operand->flags & V850E_IMMEDIATE23)
|
|
|
|
|
{
|
|
|
|
|
if (reloc != BFD_RELOC_V850_23)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
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
|
|
|
|
extra_data_after_insn = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 2;
|
|
|
|
|
extra_data = 0;
|
|
|
|
|
}
|
|
|
|
|
else if ((operand->flags & V850E_IMMEDIATE16)
|
|
|
|
|
|| (operand->flags & V850E_IMMEDIATE16HI))
|
|
|
|
|
{
|
|
|
|
|
if (operand->flags & V850E_IMMEDIATE16HI
|
|
|
|
|
&& reloc != BFD_RELOC_HI16
|
|
|
|
|
&& reloc != BFD_RELOC_HI16_S)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
else if (operand->flags & V850E_IMMEDIATE16
|
|
|
|
|
&& reloc != BFD_RELOC_LO16)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
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
|
|
|
|
extra_data_after_insn = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 2;
|
|
|
|
|
extra_data = 0;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (fc > MAX_INSN_FIXUPS)
|
|
|
|
|
as_fatal (_("too many fixups"));
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
fixups[fc].exp = ex;
|
|
|
|
|
fixups[fc].opindex = *opindex_ptr;
|
|
|
|
|
fixups[fc].reloc = reloc;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
fc++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
else if (operand->flags & V850E_IMMEDIATE16
|
|
|
|
|
|| operand->flags & V850E_IMMEDIATE16HI)
|
|
|
|
|
{
|
|
|
|
|
expression (&ex);
|
|
|
|
|
|
|
|
|
|
switch (ex.X_op)
|
|
|
|
|
{
|
|
|
|
|
case O_constant:
|
|
|
|
|
if (operand->flags & V850E_IMMEDIATE16HI)
|
|
|
|
|
{
|
|
|
|
|
if (ex.X_add_number & 0xffff)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("constant too big to fit into instruction");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ex.X_add_number >>= 16;
|
|
|
|
|
}
|
|
|
|
|
if (operand->flags & V850E_IMMEDIATE16)
|
|
|
|
|
{
|
2013-01-24 19:14:05 +08:00
|
|
|
|
if ((ex.X_add_number & 0xffff8000)
|
|
|
|
|
&& ((ex.X_add_number & 0xffff8000) != 0xffff8000))
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("constant too big to fit into instruction");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case O_illegal:
|
|
|
|
|
errmsg = _("illegal operand");
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
case O_absent:
|
|
|
|
|
errmsg = _("missing operand");
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
if (fc >= MAX_INSN_FIXUPS)
|
|
|
|
|
as_fatal (_("too many fixups"));
|
|
|
|
|
|
|
|
|
|
fixups[fc].exp = ex;
|
|
|
|
|
fixups[fc].opindex = *opindex_ptr;
|
|
|
|
|
fixups[fc].reloc = operand->default_reloc;
|
|
|
|
|
++fc;
|
|
|
|
|
|
|
|
|
|
ex.X_add_number = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
extra_data_after_insn = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 2;
|
|
|
|
|
extra_data = ex.X_add_number;
|
|
|
|
|
}
|
|
|
|
|
else if (operand->flags & V850E_IMMEDIATE23)
|
|
|
|
|
{
|
|
|
|
|
expression (&ex);
|
|
|
|
|
|
|
|
|
|
switch (ex.X_op)
|
|
|
|
|
{
|
|
|
|
|
case O_constant:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case O_illegal:
|
|
|
|
|
errmsg = _("illegal operand");
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
case O_absent:
|
|
|
|
|
errmsg = _("missing operand");
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fc >= MAX_INSN_FIXUPS)
|
|
|
|
|
as_fatal (_("too many fixups"));
|
|
|
|
|
|
|
|
|
|
fixups[fc].exp = ex;
|
|
|
|
|
fixups[fc].opindex = *opindex_ptr;
|
|
|
|
|
fixups[fc].reloc = operand->default_reloc;
|
|
|
|
|
++fc;
|
|
|
|
|
|
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
|
|
|
|
extra_data_after_insn = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 2;
|
|
|
|
|
extra_data = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (operand->flags & V850E_IMMEDIATE32)
|
|
|
|
|
{
|
|
|
|
|
expression (&ex);
|
|
|
|
|
|
|
|
|
|
switch (ex.X_op)
|
|
|
|
|
{
|
|
|
|
|
case O_constant:
|
|
|
|
|
if ((operand->default_reloc == BFD_RELOC_V850_32_ABS
|
|
|
|
|
|| operand->default_reloc == BFD_RELOC_V850_32_PCREL)
|
|
|
|
|
&& (ex.X_add_number & 1))
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("odd number cannot be used here");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case O_illegal:
|
|
|
|
|
errmsg = _("illegal operand");
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
case O_absent:
|
|
|
|
|
errmsg = _("missing operand");
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
if (fc >= MAX_INSN_FIXUPS)
|
|
|
|
|
as_fatal (_("too many fixups"));
|
|
|
|
|
|
|
|
|
|
fixups[fc].exp = ex;
|
|
|
|
|
fixups[fc].opindex = *opindex_ptr;
|
|
|
|
|
fixups[fc].reloc = operand->default_reloc;
|
|
|
|
|
++fc;
|
|
|
|
|
|
|
|
|
|
ex.X_add_number = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
extra_data_after_insn = true;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
extra_data_len = 4;
|
|
|
|
|
extra_data = ex.X_add_number;
|
|
|
|
|
}
|
|
|
|
|
else if (operand->flags & V850E_OPERAND_REG_LIST)
|
|
|
|
|
{
|
|
|
|
|
errmsg = parse_register_list (&insn, operand);
|
|
|
|
|
|
|
|
|
|
if (errmsg)
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
errmsg = NULL;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
if ((operand->flags & V850_OPERAND_REG) != 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if (!register_name (&ex))
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("invalid register name");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((operand->flags & V850_NOT_R0)
|
2000-08-02 03:02:49 +08:00
|
|
|
|
&& ex.X_add_number == 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("register r0 cannot be used here");
|
2010-07-23 22:52:54 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->flags & V850_REG_EVEN)
|
|
|
|
|
{
|
|
|
|
|
if (ex.X_add_number % 2)
|
|
|
|
|
errmsg = _("odd register cannot be used here");
|
|
|
|
|
ex.X_add_number = ex.X_add_number / 2;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
else if ((operand->flags & V850_OPERAND_SRG) != 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
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
|
|
|
|
if (!system_register_name (&ex, true))
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("invalid system register name");
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
else if ((operand->flags & V850_OPERAND_EP) != 0)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
char *start = input_line_pointer;
|
2015-08-21 23:42:14 +08:00
|
|
|
|
char *name;
|
|
|
|
|
char c = get_symbol_name (&name);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2015-08-21 23:42:14 +08:00
|
|
|
|
if (strcmp (name, "ep") != 0 && strcmp (name, "r30") != 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
/* Put things back the way we found them. */
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
input_line_pointer = start;
|
|
|
|
|
errmsg = _("expected EP register");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
str = input_line_pointer;
|
|
|
|
|
input_line_pointer = hold;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
while (*str == ' ' || *str == ','
|
|
|
|
|
|| *str == '[' || *str == ']')
|
|
|
|
|
++str;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
continue;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
else if ((operand->flags & V850_OPERAND_CC) != 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
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
|
|
|
|
if (!cc_name (&ex, true))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
errmsg = _("invalid condition code name");
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if ((operand->flags & V850_NOT_SA)
|
|
|
|
|
&& ex.X_add_number == COND_SA_NUM)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("condition sa cannot be used here");
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
else if ((operand->flags & V850_OPERAND_FLOAT_CC) != 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
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
|
|
|
|
if (!float_cc_name (&ex, true))
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("invalid condition code name");
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2013-01-24 19:14:05 +08:00
|
|
|
|
else if ((operand->flags & V850_OPERAND_CACHEOP) != 0)
|
|
|
|
|
{
|
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
|
|
|
|
if (!cacheop_name (&ex, true))
|
2017-01-23 23:23:07 +08:00
|
|
|
|
errmsg = _("invalid cache operation name");
|
2013-01-24 19:14:05 +08:00
|
|
|
|
}
|
|
|
|
|
else if ((operand->flags & V850_OPERAND_PREFOP) != 0)
|
|
|
|
|
{
|
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
|
|
|
|
if (!prefop_name (&ex, true))
|
2017-01-23 23:23:07 +08:00
|
|
|
|
errmsg = _("invalid pref operation name");
|
2013-01-24 19:14:05 +08:00
|
|
|
|
}
|
|
|
|
|
else if ((operand->flags & V850_OPERAND_VREG) != 0)
|
|
|
|
|
{
|
|
|
|
|
if (!vector_register_name (&ex))
|
|
|
|
|
errmsg = _("invalid vector register name");
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
else if ((register_name (&ex)
|
|
|
|
|
&& (operand->flags & V850_OPERAND_REG) == 0))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2015-08-21 23:42:14 +08:00
|
|
|
|
char *name;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
char c;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int exists = 0;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* It is possible that an alias has been defined that
|
|
|
|
|
matches a register name. For example the code may
|
|
|
|
|
include a ".set ZERO, 0" directive, which matches
|
|
|
|
|
the register name "zero". Attempt to reparse the
|
|
|
|
|
field as an expression, and only complain if we
|
|
|
|
|
cannot generate a constant. */
|
|
|
|
|
|
|
|
|
|
input_line_pointer = str;
|
|
|
|
|
|
2015-08-21 23:42:14 +08:00
|
|
|
|
c = get_symbol_name (&name);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2015-08-21 23:42:14 +08:00
|
|
|
|
if (symbol_find (name) != NULL)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
exists = 1;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2015-08-21 23:42:14 +08:00
|
|
|
|
(void) restore_line_pointer (c);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
input_line_pointer = str;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
expression (&ex);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
if (ex.X_op != O_constant)
|
|
|
|
|
{
|
2003-11-22 23:32:28 +08:00
|
|
|
|
/* If this register is actually occurring too early on
|
1999-05-03 15:29:11 +08:00
|
|
|
|
the parsing of the instruction, (because another
|
|
|
|
|
field is missing) then report this. */
|
|
|
|
|
if (opindex_ptr[1] != 0
|
2010-07-23 22:52:54 +08:00
|
|
|
|
&& ((v850_operands[opindex_ptr[1]].flags
|
|
|
|
|
& V850_OPERAND_REG)
|
|
|
|
|
||(v850_operands[opindex_ptr[1]].flags
|
|
|
|
|
& V850_OPERAND_VREG)))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
errmsg = _("syntax error: value is missing before the register name");
|
|
|
|
|
else
|
|
|
|
|
errmsg = _("syntax error: register not expected");
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* If we created a symbol in the process of this
|
|
|
|
|
test then delete it now, so that it will not
|
|
|
|
|
be output with the real symbols... */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (exists == 0
|
|
|
|
|
&& ex.X_op == O_symbol)
|
|
|
|
|
symbol_remove (ex.X_add_symbol,
|
2000-08-02 03:02:49 +08:00
|
|
|
|
&symbol_rootP, &symbol_lastP);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
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
|
|
|
|
else if (system_register_name (&ex, false)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
&& (operand->flags & V850_OPERAND_SRG) == 0)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("syntax error: system register not expected");
|
|
|
|
|
}
|
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
|
|
|
|
else if (cc_name (&ex, false)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
&& (operand->flags & V850_OPERAND_CC) == 0)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("syntax error: condition code not expected");
|
|
|
|
|
}
|
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
|
|
|
|
else if (float_cc_name (&ex, false)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
&& (operand->flags & V850_OPERAND_FLOAT_CC) == 0)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("syntax error: condition code not expected");
|
|
|
|
|
}
|
2013-01-24 19:14:05 +08:00
|
|
|
|
else if (vector_register_name (&ex)
|
|
|
|
|
&& (operand->flags & V850_OPERAND_VREG) == 0)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("syntax error: vector register not expected");
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
expression (&ex);
|
gas: equates of registers
There are two problems: symbol_equated_p() doesn't recognize equates of
registers, and S_CAN_BE_REDEFINED() goes by section rather than by
expression type. Both together undermine .eqv and .equiv clearly meaning
to guard the involved symbols against re-definition (both ways).
To compensate pseudo_set() now using O_symbol and S_CAN_BE_REDEFINED()
now checking for O_register,
- for targets creating register symbols through symbol_{new,create}() ->
symbol_init() -> S_SET_VALUE() (alpha, arc, dlx, ia64, m68k, mips,
mmix, tic4x, tic54x, plus anything using cgen or itbl-ops), have
symbol_init() set their expressions to O_register,
- x86'es parse_register() also can't go by section anymore when
trying to "look through" equates; probably symbol_equated_p() should
have been used there from the beginning, if only that had worked for
equates of registers,
- various targets need to "look through" equates when parsing insn
operands (which also helps transitive forward equates); perhaps even
more ought to, but many don't look to consider the possibility of
register equates in the first place.
This was uncovered by code reported in PR gas/30274 (duplicating
PR gas/30272), except that there .eqv was used when really .equ was
meant. Therefore that bug report is addressed here only in so far as
gas wouldn't crash anymore; the code there still won't assemble
successfully, just that now the issues there are properly diagnosed.
2023-05-12 14:55:48 +08:00
|
|
|
|
resolve_register (&ex);
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
if ((operand->flags & V850_NOT_IMM0)
|
|
|
|
|
&& ex.X_op == O_constant
|
|
|
|
|
&& ex.X_add_number == 0)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate 0 cannot be used here");
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* Special case:
|
2010-07-23 22:52:54 +08:00
|
|
|
|
If we are assembling a MOV/JARL/JR instruction and the immediate
|
2002-08-16 15:01:47 +08:00
|
|
|
|
value does not fit into the bits available then create a
|
2010-07-23 22:52:54 +08:00
|
|
|
|
fake error so that the next MOV/JARL/JR instruction will be
|
2002-08-16 15:01:47 +08:00
|
|
|
|
selected. This one has a 32 bit immediate field. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if ((strcmp (opcode->name, "mov") == 0
|
|
|
|
|
|| strcmp (opcode->name, "jarl") == 0
|
|
|
|
|
|| strcmp (opcode->name, "jr") == 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
&& ex.X_op == O_constant
|
2000-08-02 03:02:49 +08:00
|
|
|
|
&& (ex.X_add_number < (-(1 << (operand->bits - 1)))
|
2002-07-31 17:17:52 +08:00
|
|
|
|
|| ex.X_add_number > ((1 << (operand->bits - 1)) - 1)))
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is too large");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((strcmp (opcode->name, "jarl") == 0
|
|
|
|
|
|| strcmp (opcode->name, "jr") == 0)
|
|
|
|
|
&& ex.X_op != O_constant
|
|
|
|
|
&& operand->bits != default_disp_size)
|
|
|
|
|
{
|
|
|
|
|
errmsg = _("immediate operand is not match");
|
|
|
|
|
}
|
2013-01-24 19:14:05 +08:00
|
|
|
|
|
|
|
|
|
/* Special case2 :
|
|
|
|
|
If we are assembling a ld/st instruction and the immediate
|
|
|
|
|
value does not fit into the bits available then create a
|
|
|
|
|
fake error so that the next ld/st instruction will be
|
|
|
|
|
selected. */
|
2021-03-22 20:33:04 +08:00
|
|
|
|
if ( ( (startswith (opcode->name, "st."))
|
|
|
|
|
|| (startswith (opcode->name, "ld.")))
|
2013-01-24 19:14:05 +08:00
|
|
|
|
&& ex.X_op == O_constant
|
|
|
|
|
&& (ex.X_add_number < (-(1 << (operand->bits - 1)))
|
|
|
|
|
|| ex.X_add_number > ((1 << (operand->bits - 1)) - 1)))
|
|
|
|
|
errmsg = _("displacement is too large");
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (errmsg)
|
|
|
|
|
goto error;
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
switch (ex.X_op)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
case O_illegal:
|
|
|
|
|
errmsg = _("illegal operand");
|
|
|
|
|
goto error;
|
|
|
|
|
case O_absent:
|
|
|
|
|
errmsg = _("missing operand");
|
|
|
|
|
goto error;
|
|
|
|
|
case O_register:
|
2000-08-02 03:02:49 +08:00
|
|
|
|
if ((operand->flags
|
2010-07-23 22:52:54 +08:00
|
|
|
|
& (V850_OPERAND_REG | V850_OPERAND_SRG | V850_OPERAND_VREG)) == 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
errmsg = _("invalid operand");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
insn = v850_insert_operand (insn, operand,
|
|
|
|
|
ex.X_add_number,
|
|
|
|
|
&warningmsg);
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case O_constant:
|
|
|
|
|
insn = v850_insert_operand (insn, operand, ex.X_add_number,
|
2010-07-23 22:52:54 +08:00
|
|
|
|
&warningmsg);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
/* We need to generate a fixup for this expression. */
|
|
|
|
|
if (fc >= MAX_INSN_FIXUPS)
|
|
|
|
|
as_fatal (_("too many fixups"));
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
fixups[fc].exp = ex;
|
|
|
|
|
fixups[fc].opindex = *opindex_ptr;
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
fixups[fc].reloc = BFD_RELOC_NONE;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
++fc;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
str = input_line_pointer;
|
|
|
|
|
input_line_pointer = hold;
|
|
|
|
|
|
|
|
|
|
while (*str == ' ' || *str == ',' || *str == '[' || *str == ']'
|
|
|
|
|
|| *str == ')')
|
|
|
|
|
++str;
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
while (ISSPACE (*str))
|
|
|
|
|
++str;
|
|
|
|
|
|
|
|
|
|
if (*str == '\0')
|
|
|
|
|
match = 1;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
if (match == 0)
|
2000-08-02 03:02:49 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if ((opindex_ptr - opcode->operands) >= most_match_count)
|
|
|
|
|
{
|
|
|
|
|
most_match_count = opindex_ptr - opcode->operands;
|
|
|
|
|
if (errmsg != NULL)
|
|
|
|
|
strncpy (most_match_errmsg, errmsg, sizeof (most_match_errmsg)-1);
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
next_opcode = opcode + 1;
|
|
|
|
|
if (next_opcode->name != NULL
|
|
|
|
|
&& strcmp (next_opcode->name, opcode->name) == 0)
|
|
|
|
|
{
|
|
|
|
|
opcode = next_opcode;
|
|
|
|
|
|
|
|
|
|
/* Skip versions that are not supported by the target
|
|
|
|
|
processor. */
|
|
|
|
|
if ((opcode->processors & processor_mask) == 0)
|
|
|
|
|
goto error;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
continue;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (most_match_errmsg[0] == 0)
|
|
|
|
|
/* xgettext:c-format. */
|
|
|
|
|
as_bad (_("junk at end of line: `%s'"), str);
|
|
|
|
|
else
|
|
|
|
|
as_bad ("%s: %s", copy_of_instruction, most_match_errmsg);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
if (*input_line_pointer == ']')
|
|
|
|
|
++input_line_pointer;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
ignore_rest_of_line ();
|
|
|
|
|
input_line_pointer = saved_input_line_pointer;
|
|
|
|
|
return;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
if (warningmsg != NULL)
|
2010-08-02 16:43:18 +08:00
|
|
|
|
as_warn ("%s", warningmsg);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
input_line_pointer = str;
|
|
|
|
|
|
2001-05-16 09:08:21 +08:00
|
|
|
|
/* Tie dwarf2 debug info to the address at the start of the insn.
|
|
|
|
|
We can't do this after the insn has been output as the current
|
|
|
|
|
frag may have been closed off. eg. by frag_var. */
|
|
|
|
|
dwarf2_emit_insn (0);
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Write out the instruction. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (relaxable && fc > 0)
|
|
|
|
|
{
|
|
|
|
|
insn_size = 2;
|
|
|
|
|
fc = 0;
|
|
|
|
|
|
2013-01-24 19:14:05 +08:00
|
|
|
|
if (strcmp (opcode->name, "loop") == 0)
|
|
|
|
|
{
|
|
|
|
|
if (((processor_mask & PROCESSOR_V850E3V5_UP) == 0) || default_disp_size == 22)
|
|
|
|
|
{
|
|
|
|
|
insn_size = 4;
|
|
|
|
|
f = frag_var (rs_machine_dependent, 6, 2, SUBYPTE_LOOP_16_22,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f+4, 0, 4);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
as_bad (_("loop: 32-bit displacement not supported"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (opcode->name, "br") == 0
|
|
|
|
|
|| strcmp (opcode->name, "jbr") == 0)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2013-01-24 19:14:05 +08:00
|
|
|
|
if ((processor_mask & PROCESSOR_V850E2_UP) == 0 || default_disp_size == 22)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 4, 2, SUBYPTE_UNCOND_9_22,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 6, 4, SUBYPTE_UNCOND_9_22_32,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 4);
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
else /* b<cond>, j<cond>. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (default_disp_size == 22
|
2013-01-24 19:14:05 +08:00
|
|
|
|
|| (processor_mask & PROCESSOR_V850E2_UP) == 0)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
2013-01-24 19:14:05 +08:00
|
|
|
|
if (processor_mask & PROCESSOR_V850E2V3_UP && !no_bcond17)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
if (strcmp (opcode->name, "bsa") == 0)
|
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 8, 6, SUBYPTE_SA_9_17_22,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 6);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 6, 4, SUBYPTE_COND_9_17_22,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (strcmp (opcode->name, "bsa") == 0)
|
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 8, 6, SUBYPTE_SA_9_22,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 6);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 6, 4, SUBYPTE_COND_9_22,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-01-24 19:14:05 +08:00
|
|
|
|
if (processor_mask & PROCESSOR_V850E2V3_UP && !no_bcond17)
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
if (strcmp (opcode->name, "bsa") == 0)
|
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 10, 8, SUBYPTE_SA_9_17_22_32,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 8);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 8, 6, SUBYPTE_COND_9_17_22_32,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 6);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (strcmp (opcode->name, "bsa") == 0)
|
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 10, 8, SUBYPTE_SA_9_22_32,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 8);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
f = frag_var (rs_machine_dependent, 8, 6, SUBYPTE_COND_9_22_32,
|
|
|
|
|
fixups[0].exp.X_add_symbol,
|
|
|
|
|
fixups[0].exp.X_add_number,
|
|
|
|
|
(char *)(size_t) fixups[0].opindex);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
md_number_to_chars (f + 2, 0, 6);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
else
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
/* Four byte insns have an opcode with the two high bits on. */
|
|
|
|
|
if ((insn & 0x0600) == 0x0600)
|
|
|
|
|
insn_size = 4;
|
|
|
|
|
else
|
|
|
|
|
insn_size = 2;
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Special case: 32 bit MOV. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if ((insn & 0xffe0) == 0x0620)
|
|
|
|
|
insn_size = 2;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* Special case: 32 bit JARL,JMP,JR. */
|
|
|
|
|
if ((insn & 0x1ffe0) == 0x2e0 /* JARL. */
|
|
|
|
|
|| (insn & 0x1ffe0) == 0x6e0 /* JMP. */
|
|
|
|
|
|| (insn & 0x1ffff) == 0x2e0) /* JR. */
|
|
|
|
|
insn_size = 2;
|
|
|
|
|
|
2013-01-24 19:14:05 +08:00
|
|
|
|
if (obstack_room (& frchain_now->frch_obstack) < (insn_size + extra_data_len))
|
|
|
|
|
{
|
|
|
|
|
frag_wane (frag_now);
|
|
|
|
|
frag_new (0);
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
f = frag_more (insn_size);
|
|
|
|
|
md_number_to_chars (f, insn, insn_size);
|
|
|
|
|
|
|
|
|
|
if (extra_data_after_insn)
|
|
|
|
|
{
|
|
|
|
|
f = frag_more (extra_data_len);
|
|
|
|
|
md_number_to_chars (f, extra_data, extra_data_len);
|
|
|
|
|
|
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
|
|
|
|
extra_data_after_insn = false;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Create any fixups. At this point we do not use a
|
|
|
|
|
bfd_reloc_code_real_type, but instead just use the
|
|
|
|
|
BFD_RELOC_UNUSED plus the operand index. This lets us easily
|
|
|
|
|
handle fixups for any operand type, although that is admittedly
|
|
|
|
|
not a very exciting feature. We pick a BFD reloc type in
|
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. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
for (i = 0; i < fc; i++)
|
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
const struct v850_operand *operand;
|
|
|
|
|
bfd_reloc_code_real_type reloc;
|
|
|
|
|
|
|
|
|
|
operand = &v850_operands[fixups[i].opindex];
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
reloc = fixups[i].reloc;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
if (reloc != BFD_RELOC_NONE)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
reloc_howto_type *reloc_howto =
|
|
|
|
|
bfd_reloc_type_lookup (stdoutput, reloc);
|
|
|
|
|
int size;
|
|
|
|
|
int address;
|
|
|
|
|
fixS *fixP;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
if (!reloc_howto)
|
2000-08-02 03:02:49 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
size = bfd_get_reloc_size (reloc_howto);
|
|
|
|
|
|
|
|
|
|
/* XXX This will abort on an R_V850_8 reloc -
|
2000-08-02 03:02:49 +08:00
|
|
|
|
is this reloc actually used? */
|
|
|
|
|
if (size != 2 && size != 4)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (extra_data_len == 0)
|
|
|
|
|
{
|
|
|
|
|
address = (f - frag_now->fr_literal) + insn_size - size;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
address = (f - frag_now->fr_literal) + extra_data_len - size;
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if ((operand->flags & V850E_IMMEDIATE32) && (operand->flags & V850_PCREL))
|
|
|
|
|
{
|
|
|
|
|
fixups[i].exp.X_add_number += 2;
|
|
|
|
|
}
|
|
|
|
|
else if (operand->default_reloc == BFD_RELOC_V850_16_PCREL)
|
|
|
|
|
{
|
|
|
|
|
fixups[i].exp.X_add_number += 2;
|
|
|
|
|
address += 2;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
/* fprintf (stderr, "0x%x %d %ld\n", address, size, fixups[i].exp.X_add_number); */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
fixP = fix_new_exp (frag_now, address, size,
|
2000-08-02 03:02:49 +08:00
|
|
|
|
&fixups[i].exp,
|
1999-05-03 15:29:11 +08:00
|
|
|
|
reloc_howto->pc_relative,
|
|
|
|
|
reloc);
|
|
|
|
|
|
2005-05-17 19:56:13 +08:00
|
|
|
|
fixP->tc_fix_data = (void *) operand;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
switch (reloc)
|
|
|
|
|
{
|
|
|
|
|
case BFD_RELOC_LO16:
|
2010-07-23 22:52:54 +08:00
|
|
|
|
case BFD_RELOC_V850_LO16_S1:
|
2004-12-17 00:56:04 +08:00
|
|
|
|
case BFD_RELOC_V850_LO16_SPLIT_OFFSET:
|
1999-05-03 15:29:11 +08:00
|
|
|
|
case BFD_RELOC_HI16:
|
|
|
|
|
case BFD_RELOC_HI16_S:
|
|
|
|
|
fixP->fx_no_overflow = 1;
|
|
|
|
|
break;
|
2000-06-19 08:59:43 +08:00
|
|
|
|
default:
|
|
|
|
|
break;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-01-24 19:14:05 +08:00
|
|
|
|
gas_assert (f != NULL);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
fix_new_exp (frag_now,
|
1999-05-03 15:29:11 +08:00
|
|
|
|
f - frag_now->fr_literal, 4,
|
|
|
|
|
& fixups[i].exp,
|
2010-07-23 22:52:54 +08:00
|
|
|
|
(operand->flags & V850_PCREL) != 0,
|
1999-05-03 15:29:11 +08:00
|
|
|
|
(bfd_reloc_code_real_type) (fixups[i].opindex
|
2000-08-02 03:02:49 +08:00
|
|
|
|
+ (int) BFD_RELOC_UNUSED));
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
input_line_pointer = saved_input_line_pointer;
|
|
|
|
|
}
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* If while processing a fixup, a reloc really needs to be created
|
|
|
|
|
then it is done here. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
arelent *
|
2005-03-25 04:40:28 +08:00
|
|
|
|
tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
arelent *reloc;
|
|
|
|
|
|
2016-04-07 04:26:46 +08:00
|
|
|
|
reloc = XNEW (arelent);
|
|
|
|
|
reloc->sym_ptr_ptr = XNEW (asymbol *);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
|
|
|
|
|
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
|
2003-06-04 00:24:06 +08:00
|
|
|
|
|
|
|
|
|
if ( fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
|
|
|
|
|
|| fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|
|
|
|
|
|| fixp->fx_r_type == BFD_RELOC_V850_LONGCALL
|
|
|
|
|
|| fixp->fx_r_type == BFD_RELOC_V850_LONGJUMP
|
|
|
|
|
|| fixp->fx_r_type == BFD_RELOC_V850_ALIGN)
|
|
|
|
|
reloc->addend = fixp->fx_offset;
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
#if 0
|
2003-06-04 00:24:06 +08:00
|
|
|
|
if (fixp->fx_r_type == BFD_RELOC_32
|
|
|
|
|
&& fixp->fx_pcrel)
|
|
|
|
|
fixp->fx_r_type = BFD_RELOC_32_PCREL;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
#endif
|
2003-06-04 00:24:06 +08:00
|
|
|
|
|
|
|
|
|
reloc->addend = fixp->fx_addnumber;
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-15 12:04:18 +08:00
|
|
|
|
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2005-03-25 04:40:28 +08:00
|
|
|
|
if (reloc->howto == NULL)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
as_bad_where (fixp->fx_file, fixp->fx_line,
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* xgettext:c-format */
|
|
|
|
|
_("reloc %d not supported by object file format"),
|
1999-05-03 15:29:11 +08:00
|
|
|
|
(int) fixp->fx_r_type);
|
|
|
|
|
|
|
|
|
|
xfree (reloc);
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
return reloc;
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-29 14:49:35 +08:00
|
|
|
|
void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
v850_handle_align (fragS * frag)
|
2002-08-29 14:49:35 +08:00
|
|
|
|
{
|
|
|
|
|
if (v850_relax
|
|
|
|
|
&& frag->fr_type == rs_align
|
|
|
|
|
&& frag->fr_address + frag->fr_fix > 0
|
|
|
|
|
&& frag->fr_offset > 1
|
|
|
|
|
&& now_seg != bss_section
|
|
|
|
|
&& now_seg != v850_seg_table[SBSS_SECTION].s
|
|
|
|
|
&& now_seg != v850_seg_table[TBSS_SECTION].s
|
|
|
|
|
&& now_seg != v850_seg_table[ZBSS_SECTION].s)
|
|
|
|
|
fix_new (frag, frag->fr_fix, 2, & abs_symbol, frag->fr_offset, 0,
|
2003-07-15 12:04:18 +08:00
|
|
|
|
BFD_RELOC_V850_ALIGN);
|
2002-08-29 14:49:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-10 19:32:52 +08:00
|
|
|
|
/* Return current size of variable part of frag. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
int
|
2005-03-25 04:40:28 +08:00
|
|
|
|
md_estimate_size_before_relax (fragS *fragp, asection *seg ATTRIBUTE_UNUSED)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2001-05-10 19:32:52 +08:00
|
|
|
|
if (fragp->fr_subtype >= sizeof (md_relax_table) / sizeof (md_relax_table[0]))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
abort ();
|
2001-05-10 19:32:52 +08:00
|
|
|
|
|
|
|
|
|
return md_relax_table[fragp->fr_subtype].rlx_length;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
long
|
2005-03-25 04:40:28 +08:00
|
|
|
|
v850_pcrel_from_section (fixS *fixp, segT section)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
/* If the symbol is undefined, or in a section other than our own,
|
1999-11-06 22:05:24 +08:00
|
|
|
|
or it is weak (in which case it may well be in another section,
|
1999-05-03 15:29:11 +08:00
|
|
|
|
then let the linker figure it out. */
|
|
|
|
|
if (fixp->fx_addsy != (symbolS *) NULL
|
|
|
|
|
&& (! S_IS_DEFINED (fixp->fx_addsy)
|
1999-11-06 22:05:24 +08:00
|
|
|
|
|| S_IS_WEAK (fixp->fx_addsy)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|| (S_GET_SEGMENT (fixp->fx_addsy) != section)))
|
1999-11-06 22:05:24 +08:00
|
|
|
|
return 0;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
return fixp->fx_frag->fr_address + fixp->fx_where;
|
|
|
|
|
}
|
|
|
|
|
|
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, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2001-11-16 05:29:00 +08:00
|
|
|
|
valueT value = * valueP;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
char *where;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2001-11-16 05:29:00 +08:00
|
|
|
|
if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|
2002-08-29 14:49:35 +08:00
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_V850_LONGCALL
|
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_V850_LONGJUMP
|
2001-11-16 05:29:00 +08:00
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2001-11-16 05:29:00 +08:00
|
|
|
|
fixP->fx_done = 0;
|
|
|
|
|
return;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
2001-11-16 05:29:00 +08:00
|
|
|
|
if (fixP->fx_addsy == (symbolS *) NULL)
|
2002-08-29 14:49:35 +08:00
|
|
|
|
fixP->fx_addnumber = value,
|
2001-11-16 05:29:00 +08:00
|
|
|
|
fixP->fx_done = 1;
|
|
|
|
|
|
|
|
|
|
else if (fixP->fx_pcrel)
|
2002-08-29 14:49:35 +08:00
|
|
|
|
fixP->fx_addnumber = fixP->fx_offset;
|
2001-11-16 05:29:00 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
2001-11-16 05:29:00 +08:00
|
|
|
|
value = fixP->fx_offset;
|
|
|
|
|
if (fixP->fx_subsy != (symbolS *) NULL)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2001-11-16 05:29:00 +08:00
|
|
|
|
if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)
|
|
|
|
|
value -= S_GET_VALUE (fixP->fx_subsy);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
2005-03-25 04:40:28 +08:00
|
|
|
|
/* We don't actually support subtracting a symbol. */
|
2021-07-21 13:09:29 +08:00
|
|
|
|
as_bad_subtract (fixP);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2002-08-29 14:49:35 +08:00
|
|
|
|
fixP->fx_addnumber = value;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
2001-11-16 05:29:00 +08:00
|
|
|
|
if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2000-08-02 03:02:49 +08:00
|
|
|
|
int opindex;
|
|
|
|
|
const struct v850_operand *operand;
|
|
|
|
|
unsigned long insn;
|
2010-07-23 22:52:54 +08:00
|
|
|
|
const char *errmsg = NULL;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2001-11-16 05:29:00 +08:00
|
|
|
|
opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
operand = &v850_operands[opindex];
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
/* Fetch the instruction, insert the fully resolved operand
|
2003-07-15 12:04:18 +08:00
|
|
|
|
value, and stuff the instruction back again.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
Note the instruction has been stored in little endian
|
|
|
|
|
format! */
|
2001-11-16 05:29:00 +08:00
|
|
|
|
where = fixP->fx_frag->fr_literal + fixP->fx_where;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (fixP->fx_size > 2)
|
|
|
|
|
insn = bfd_getl32 ((unsigned char *) where);
|
|
|
|
|
else
|
|
|
|
|
insn = bfd_getl16 ((unsigned char *) where);
|
|
|
|
|
|
2017-01-23 23:23:07 +08:00
|
|
|
|
/* When inserting loop offsets a backwards displacement
|
2013-04-04 15:24:08 +08:00
|
|
|
|
is encoded as a positive value. */
|
|
|
|
|
if (operand->flags & V850_INVERSE_PCREL)
|
|
|
|
|
value = - value;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
insn = v850_insert_operand (insn, operand, (offsetT) value,
|
2010-07-23 22:52:54 +08:00
|
|
|
|
&errmsg);
|
|
|
|
|
if (errmsg)
|
2010-08-02 16:43:18 +08:00
|
|
|
|
as_warn_where (fixP->fx_file, fixP->fx_line, "%s", errmsg);
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
if (fixP->fx_size > 2)
|
|
|
|
|
bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
|
|
|
|
|
else
|
|
|
|
|
bfd_putl16 ((bfd_vma) insn, (unsigned char *) where);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2001-11-16 05:29:00 +08:00
|
|
|
|
if (fixP->fx_done)
|
|
|
|
|
/* Nothing else to do here. */
|
|
|
|
|
return;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* Determine a BFD reloc value based on the operand information.
|
|
|
|
|
We are only prepared to turn a few of the operands into relocs. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2010-07-23 22:52:54 +08:00
|
|
|
|
if (operand->default_reloc == BFD_RELOC_NONE)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2001-11-16 05:29:00 +08:00
|
|
|
|
as_bad_where (fixP->fx_file, fixP->fx_line,
|
2000-08-02 03:02:49 +08:00
|
|
|
|
_("unresolved expression that must be resolved"));
|
2001-11-16 05:29:00 +08:00
|
|
|
|
fixP->fx_done = 1;
|
|
|
|
|
return;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
fixP->fx_r_type = operand->default_reloc;
|
|
|
|
|
if (operand->default_reloc == BFD_RELOC_V850_16_PCREL)
|
|
|
|
|
{
|
|
|
|
|
fixP->fx_where += 2;
|
|
|
|
|
fixP->fx_size = 2;
|
|
|
|
|
fixP->fx_addnumber += 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2001-11-16 05:29:00 +08:00
|
|
|
|
else if (fixP->fx_done)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
/* We still have to insert the value into memory! */
|
2001-11-16 05:29:00 +08:00
|
|
|
|
where = fixP->fx_frag->fr_literal + fixP->fx_where;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
2005-05-18 17:42:13 +08:00
|
|
|
|
if (fixP->tc_fix_data != NULL
|
2010-07-23 22:52:54 +08:00
|
|
|
|
&& ((struct v850_operand *) fixP->tc_fix_data)->insert != NULL)
|
|
|
|
|
{
|
|
|
|
|
const char * message = NULL;
|
|
|
|
|
struct v850_operand * operand = (struct v850_operand *) fixP->tc_fix_data;
|
|
|
|
|
unsigned long insn;
|
|
|
|
|
|
|
|
|
|
/* The variable "where" currently points at the exact point inside
|
|
|
|
|
the insn where we need to insert the value. But we need to
|
|
|
|
|
extract the entire insn so we probably need to move "where"
|
|
|
|
|
back a few bytes. */
|
|
|
|
|
|
|
|
|
|
if (fixP->fx_size == 2)
|
|
|
|
|
where -= 2;
|
|
|
|
|
else if (fixP->fx_size == 1)
|
|
|
|
|
where -= 3;
|
|
|
|
|
|
|
|
|
|
insn = bfd_getl32 ((unsigned char *) where);
|
|
|
|
|
|
|
|
|
|
/* Use the operand's insertion procedure, if present, in order to
|
|
|
|
|
make sure that the value is correctly stored in the insn. */
|
|
|
|
|
insn = operand->insert (insn, (offsetT) value, & message);
|
|
|
|
|
/* Ignore message even if it is set. */
|
|
|
|
|
|
|
|
|
|
bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
|
|
|
|
|
}
|
2005-05-17 19:56:13 +08:00
|
|
|
|
else
|
2010-07-23 22:52:54 +08:00
|
|
|
|
{
|
|
|
|
|
switch (fixP->fx_r_type)
|
|
|
|
|
{
|
|
|
|
|
case BFD_RELOC_V850_32_ABS:
|
|
|
|
|
case BFD_RELOC_V850_32_PCREL:
|
|
|
|
|
bfd_putl32 (value & 0xfffffffe, (unsigned char *) where);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_32:
|
|
|
|
|
bfd_putl32 (value, (unsigned char *) where);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_23:
|
|
|
|
|
bfd_putl32 (((value & 0x7f) << 4) | ((value & 0x7fff80) << (16-7))
|
|
|
|
|
| (bfd_getl32 (where) & ~((0x7f << 4) | (0xffff << 16))),
|
|
|
|
|
(unsigned char *) where);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_16:
|
|
|
|
|
case BFD_RELOC_HI16:
|
|
|
|
|
case BFD_RELOC_HI16_S:
|
|
|
|
|
case BFD_RELOC_LO16:
|
|
|
|
|
case BFD_RELOC_V850_ZDA_16_16_OFFSET:
|
|
|
|
|
case BFD_RELOC_V850_SDA_16_16_OFFSET:
|
|
|
|
|
case BFD_RELOC_V850_TDA_16_16_OFFSET:
|
|
|
|
|
case BFD_RELOC_V850_CALLT_16_16_OFFSET:
|
|
|
|
|
bfd_putl16 (value & 0xffff, (unsigned char *) where);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_8:
|
|
|
|
|
*where = value & 0xff;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_9_PCREL:
|
|
|
|
|
bfd_putl16 (((value & 0x1f0) << 7) | ((value & 0x0e) << 3)
|
|
|
|
|
| (bfd_getl16 (where) & ~((0x1f0 << 7) | (0x0e << 3))), where);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_17_PCREL:
|
|
|
|
|
bfd_putl32 (((value & 0x10000) >> (16 - 4)) | ((value & 0xfffe) << 16)
|
|
|
|
|
| (bfd_getl32 (where) & ~((0x10000 >> (16 - 4)) | (0xfffe << 16))), where);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_16_PCREL:
|
2012-11-10 01:36:19 +08:00
|
|
|
|
bfd_putl16 ((-value & 0xfffe) | (bfd_getl16 (where + 2) & 0x0001),
|
|
|
|
|
(unsigned char *) (where + 2));
|
2010-07-23 22:52:54 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_22_PCREL:
|
|
|
|
|
bfd_putl32 (((value & 0xfffe) << 16) | ((value & 0x3f0000) >> 16)
|
|
|
|
|
| (bfd_getl32 (where) & ~((0xfffe << 16) | (0x3f0000 >> 16))), where);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_16_S1:
|
|
|
|
|
case BFD_RELOC_V850_LO16_S1:
|
|
|
|
|
case BFD_RELOC_V850_ZDA_15_16_OFFSET:
|
|
|
|
|
case BFD_RELOC_V850_SDA_15_16_OFFSET:
|
|
|
|
|
bfd_putl16 (value & 0xfffe, (unsigned char *) where);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_16_SPLIT_OFFSET:
|
|
|
|
|
case BFD_RELOC_V850_LO16_SPLIT_OFFSET:
|
|
|
|
|
case BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET:
|
|
|
|
|
case BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET:
|
|
|
|
|
bfd_putl32 (((value << 16) & 0xfffe0000)
|
|
|
|
|
| ((value << 5) & 0x20)
|
|
|
|
|
| (bfd_getl32 (where) & ~0xfffe0020), where);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_TDA_6_8_OFFSET:
|
|
|
|
|
*where = (*where & ~0x7e) | ((value >> 1) & 0x7e);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_TDA_7_8_OFFSET:
|
|
|
|
|
*where = (*where & ~0x7f) | ((value >> 1) & 0x7f);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_TDA_7_7_OFFSET:
|
|
|
|
|
*where = (*where & ~0x7f) | (value & 0x7f);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_TDA_4_5_OFFSET:
|
|
|
|
|
*where = (*where & ~0xf) | ((value >> 1) & 0xf);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_TDA_4_4_OFFSET:
|
|
|
|
|
*where = (*where & ~0xf) | (value & 0xf);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BFD_RELOC_V850_CALLT_6_7_OFFSET:
|
|
|
|
|
*where = (*where & ~0x3f) | (value & 0x3f);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* Parse a cons expression. We have to handle hi(), lo(), etc
|
|
|
|
|
on the v850. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
bfd_reloc_code_real_type
|
2005-03-25 04:40:28 +08:00
|
|
|
|
parse_cons_expression_v850 (expressionS *exp)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2010-07-23 22:52:54 +08:00
|
|
|
|
const char *errmsg;
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
bfd_reloc_code_real_type r;
|
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
/* See if there's a reloc prefix like hi() we have to handle. */
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
r = v850_reloc_prefix (NULL, &errmsg);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
|
|
/* Do normal expression parsing. */
|
|
|
|
|
expression (exp);
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
return r;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Create a fixup for a cons expression. If parse_cons_expression_v850
|
|
|
|
|
found a reloc prefix, then we use that reloc, else we choose an
|
|
|
|
|
appropriate one based on the size of the expression. */
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
void
|
2005-03-25 04:40:28 +08:00
|
|
|
|
cons_fix_new_v850 (fragS *frag,
|
|
|
|
|
int where,
|
|
|
|
|
int size,
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
expressionS *exp,
|
|
|
|
|
bfd_reloc_code_real_type r)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
if (r == BFD_RELOC_NONE)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
if (size == 4)
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
r = BFD_RELOC_32;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (size == 2)
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
r = BFD_RELOC_16;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (size == 1)
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
r = BFD_RELOC_8;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (exp != NULL)
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
fix_new_exp (frag, where, size, exp, 0, r);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
else
|
gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables. That's OK, but not best
practice. tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants. This patch fixes both of these warts.
* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add RELOC parameter.
* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
Similarly.
* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
* gas/config/tc-avr.c (exp_mod_data): Make global.
(pexp_mod_data): Delete.
(avr_parse_cons_expression): Return exp_mod_data pointer.
(avr_cons_fix_new): Add exp_mod_data_t pointer param.
(exp_mod_data_t): Move typedef..
* gas/config/tc-avr.h: ..to here.
(exp_mod_data): Declare.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Update.
* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
(cons_fix_new_hppa): Add hppa_field_selector param.
(fix_new_hppa): Adjust.
(parse_cons_expression_hppa): Return field selector.
* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
(cons_fix_new_hppa): Likewise.
(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
* gas/config/tc-i386.c (got_reloc): Delete static var.
(x86_cons_fix_new): Add reloc param.
(x86_cons): Return got reloc.
* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
(TC_CONS_FIX_NEW): Add RELOC param.
* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param. Adjust
calls.
* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
(TC_CONS_FIX_NEW): Add reloc param.
* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
Return reloc.
(cons_fix_new_microblaze): Add reloc param.
* gas/config/tc-microblaze.h: Formatting.
(parse_cons_expression_microblaze): Update proto.
(cons_fix_new_microblaze): Likewise.
* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
(nios2_cons): Return ldo reloc.
(nios2_cons_fix_new): Delete.
* gas/config/tc-nios2.h (nios2_cons): Update prototype.
(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
short. Make llong use cons.
(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(ppc_elf_cons): Delete.
(ppc_elf_parse_cons): New function.
(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
(ppc_elf_parse_cons): Declare.
* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
(sparc_cons): Return reloc specifier.
(cons_fix_new_sparc): Add reloc specifier param.
(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(sparc_cons, cons_fix_new_sparc): Update prototype.
* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
(md_assemble): Likewise.
(parse_cons_expression_v850): Return reloc.
(cons_fix_new_v850): Add reloc parameter.
* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
(cons_fix_new_v850): Likewise.
* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
(vax_cons): Return reloc.
(vax_cons_fix_new): Add reloc parameter.
* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
(do_parse_cons_expression): Adjust.
(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
to emit_expr_with_reloc.
(emit_expr_with_reloc): New function handling reloc, mostly
extracted from..
(emit_expr): ..here.
(emit_expr_fix): Add reloc param. Adjust TC_CONS_FIX_NEW invocation.
Handle reloc.
(parse_mri_cons): Convert to ISO.
* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
(TC_PARSE_CONS_RETURN_NONE): Define.
(emit_expr_with_reloc): Declare.
(emit_expr_fix): Update prototype.
* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-08 13:08:22 +08:00
|
|
|
|
fix_new (frag, where, size, NULL, 0, 0, r);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
1999-11-06 22:05:24 +08:00
|
|
|
|
|
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
|
|
|
|
bool
|
2005-03-25 04:40:28 +08:00
|
|
|
|
v850_fix_adjustable (fixS *fixP)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
|
|
|
|
if (fixP->fx_addsy == NULL)
|
|
|
|
|
return 1;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
|
|
|
|
/* Don't adjust function names. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
if (S_IS_FUNCTION (fixP->fx_addsy))
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-08-02 03:02:49 +08:00
|
|
|
|
/* We need the symbol name for the VTABLE entries. */
|
|
|
|
|
if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
|
|
|
|
|
return 0;
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
2000-08-02 03:02:49 +08:00
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
|
int
|
2005-03-25 04:40:28 +08:00
|
|
|
|
v850_force_relocation (struct fix *fixP)
|
1999-05-03 15:29:11 +08:00
|
|
|
|
{
|
2002-09-05 08:01:18 +08:00
|
|
|
|
if (fixP->fx_r_type == BFD_RELOC_V850_LONGCALL
|
2002-08-29 14:49:35 +08:00
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_V850_LONGJUMP)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
if (v850_relax
|
|
|
|
|
&& (fixP->fx_pcrel
|
2002-09-05 08:01:18 +08:00
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_V850_ALIGN
|
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_V850_9_PCREL
|
2010-07-23 22:52:54 +08:00
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_V850_16_PCREL
|
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_V850_17_PCREL
|
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_V850_22_PCREL
|
|
|
|
|
|| fixP->fx_r_type == BFD_RELOC_V850_32_PCREL
|
2002-09-05 08:01:18 +08:00
|
|
|
|
|| fixP->fx_r_type >= BFD_RELOC_UNUSED))
|
2002-08-29 14:49:35 +08:00
|
|
|
|
return 1;
|
|
|
|
|
|
2003-01-23 20:51:05 +08:00
|
|
|
|
return generic_force_reloc (fixP);
|
1999-05-03 15:29:11 +08:00
|
|
|
|
}
|
2015-02-25 01:54:09 +08:00
|
|
|
|
|
|
|
|
|
/* Create a v850 note section. */
|
|
|
|
|
void
|
gas: rename md_end to md_finish
Currently md_end is typically used for some final actions rather than
freeing memory like other *_end functions. Rename it to md_finish,
and rename target implementation. The renaming of target functions
makes it possible to find them all with "grep md_finish",
eg. md_mips_end is renamed to mips_md_finish, not md_mips_finish.
This patch leaves a number of md_end functions unchanged, those that
either do nothing or deallocate memory, and calls them late.
The idea here is that target maintainers implement md_end functions to
tidy memory, if anyone cares. Freeing persistent memory in gas is
not at all important, except that it can hide more important memory
leaks, those that happen once per some frequent gas operation, amongst
these unimportant memory leaks.
* as.c (main): Rename md_end to md_finish.
* 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-csky.c, * config/tc-csky.h,
* config/tc-ia64.c, * config/tc-ia64.h,
* config/tc-mcore.c, * config/tc-mcore.h,
* config/tc-mips.c, * config/tc-mips.h,
* config/tc-mmix.c, * config/tc-mmix.h,
* config/tc-msp430.c, * config/tc-msp430.h,
* config/tc-nds32.c, * config/tc-nds32.h,
* config/tc-ppc.c, * config/tc-ppc.h,
* config/tc-pru.c, * config/tc-pru.h,
* config/tc-riscv.c, * config/tc-riscv.h,
* config/tc-s390.c, * config/tc-s390.h,
* config/tc-sparc.c, * config/tc-sparc.h,
* config/tc-tic4x.c, * config/tc-tic4x.h,
* config/tc-tic6x.c, * config/tc-tic6x.h,
* config/tc-v850.c, * config/tc-v850.h,
* config/tc-xtensa.c, * config/tc-xtensa.h,
* config/tc-z80.c, * config/tc-z80.h: Similarly.
* output-file.c (output_file_close): Call md_end.
2022-07-05 11:56:38 +08:00
|
|
|
|
v850_md_finish (void)
|
2015-02-25 01:54:09 +08:00
|
|
|
|
{
|
|
|
|
|
segT note_sec;
|
|
|
|
|
segT orig_seg = now_seg;
|
|
|
|
|
subsegT orig_subseg = now_subseg;
|
|
|
|
|
enum v850_notes id;
|
|
|
|
|
|
|
|
|
|
note_sec = subseg_new (V850_NOTE_SECNAME, 0);
|
bfd_section_* macros
This large patch removes the unnecessary bfd parameter from various
bfd section macros and functions. The bfd is hardly ever used and if
needed for the bfd_set_section_* or bfd_rename_section functions can
be found via section->owner except for the com, und, abs, and ind
std_section special sections. Those sections shouldn't be modified
anyway.
The patch also removes various bfd_get_section_<field> macros,
replacing their use with bfd_section_<field>, and adds
bfd_set_section_lma. I've also fixed a minor bug in gas where
compressed section renaming was done directly rather than calling
bfd_rename_section. This would have broken bfd_get_section_by_name
and similar functions, but that hardly mattered at such a late stage
in gas processing.
bfd/
* bfd-in.h (bfd_get_section_name, bfd_get_section_vma),
(bfd_get_section_lma, bfd_get_section_alignment),
(bfd_get_section_size, bfd_get_section_flags),
(bfd_get_section_userdata): Delete.
(bfd_section_name, bfd_section_size, bfd_section_vma),
(bfd_section_lma, bfd_section_alignment): Lose bfd parameter.
(bfd_section_flags, bfd_section_userdata): New.
(bfd_is_com_section): Rename parameter.
* section.c (bfd_set_section_userdata, bfd_set_section_vma),
(bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section),
(bfd_set_section_size): Delete bfd parameter, rename section parameter.
(bfd_set_section_lma): New.
* bfd-in2.h: Regenerate.
* mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param,
update callers.
* aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h,
* elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c,
* elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c,
* elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c,
* elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c,
* elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c,
* elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c,
* elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c,
* elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
* elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
* elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c,
* elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
* elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c,
* elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c,
* mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c,
* peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c,
* xcofflink.c: Update throughout for bfd section macro and function
changes.
binutils/
* addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c,
* objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c,
* od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c,
* resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update
throughout for bfd section macro and function changes.
gas/
* as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c,
* read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c,
* config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c,
* config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c,
* config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
* config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c,
* config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c,
* config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c,
* config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c,
* config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c,
* config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c,
* config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c,
* config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c,
* config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c,
* config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c,
* config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c,
* config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c,
* config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c,
* config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c,
* config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c,
* config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c,
* config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c,
* config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for
bfd section macro and function changes.
* write.c (compress_debug): Use bfd_rename_section.
gdb/
* aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c,
* coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c,
* dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c,
* exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h,
* hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c,
* i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c,
* maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c,
* mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c,
* objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c,
* ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c,
* rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c,
* s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c,
* solib-spu.c, * solib-svr4.c, * solib-target.c,
* spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c,
* symmisc.c, * symtab.c, * target.c, * windows-nat.c,
* xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c,
* mi/mi-interp.c: Update throughout for bfd section macro and
function changes.
* gcore (gcore_create_callback): Use bfd_set_section_lma.
* spu-tdep.c (spu_overlay_new_objfile): Likewise.
gprof/
* corefile.c, * symtab.c: Update throughout for bfd section
macro and function changes.
ld/
* ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c,
* emultempl/aarch64elf.em, * emultempl/aix.em,
* emultempl/armcoff.em, * emultempl/armelf.em,
* emultempl/cr16elf.em, * emultempl/cskyelf.em,
* emultempl/m68hc1xelf.em, * emultempl/m68kelf.em,
* emultempl/mipself.em, * emultempl/mmix-elfnmmo.em,
* emultempl/mmo.em, * emultempl/msp430.em,
* emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em,
* emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update
throughout for bfd section macro and function changes.
libctf/
* ctf-open-bfd.c: Update throughout for bfd section macro changes.
opcodes/
* arc-ext.c: Update throughout for bfd section macro changes.
sim/
* common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c,
* erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c,
* m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c,
* rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c,
* rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 18:55:17 +08:00
|
|
|
|
bfd_set_section_flags (note_sec, SEC_HAS_CONTENTS | SEC_READONLY | SEC_MERGE);
|
|
|
|
|
bfd_set_section_alignment (note_sec, 2);
|
2015-02-25 01:54:09 +08:00
|
|
|
|
|
|
|
|
|
/* Provide default values for all of the notes. */
|
|
|
|
|
for (id = V850_NOTE_ALIGNMENT; id <= NUM_V850_NOTES; id++)
|
|
|
|
|
{
|
|
|
|
|
int val = 0;
|
|
|
|
|
char * p;
|
|
|
|
|
|
|
|
|
|
/* Follow the standard note section layout:
|
|
|
|
|
First write the length of the name string. */
|
|
|
|
|
p = frag_more (4);
|
|
|
|
|
md_number_to_chars (p, 4, 4);
|
|
|
|
|
|
|
|
|
|
/* Next comes the length of the "descriptor", i.e., the actual data. */
|
|
|
|
|
p = frag_more (4);
|
|
|
|
|
md_number_to_chars (p, 4, 4);
|
|
|
|
|
|
|
|
|
|
/* Write the note type. */
|
|
|
|
|
p = frag_more (4);
|
|
|
|
|
md_number_to_chars (p, (valueT) id, 4);
|
|
|
|
|
|
|
|
|
|
/* Write the name field. */
|
|
|
|
|
p = frag_more (4);
|
|
|
|
|
memcpy (p, V850_NOTE_NAME, 4);
|
|
|
|
|
|
|
|
|
|
/* Finally, write the descriptor. */
|
|
|
|
|
p = frag_more (4);
|
|
|
|
|
switch (id)
|
|
|
|
|
{
|
|
|
|
|
case V850_NOTE_ALIGNMENT:
|
|
|
|
|
val = v850_data_8 ? EF_RH850_DATA_ALIGN8 : EF_RH850_DATA_ALIGN4;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case V850_NOTE_DATA_SIZE:
|
|
|
|
|
/* GCC does not currently support an option
|
|
|
|
|
for 32-bit doubles with the V850 backend. */
|
|
|
|
|
val = EF_RH850_DOUBLE64;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case V850_NOTE_FPU_INFO:
|
|
|
|
|
if (! soft_float)
|
|
|
|
|
switch (machine)
|
|
|
|
|
{
|
|
|
|
|
case bfd_mach_v850e3v5: val = EF_RH850_FPU30; break;
|
|
|
|
|
case bfd_mach_v850e2v3: val = EF_RH850_FPU20; break;
|
|
|
|
|
default: break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
md_number_to_chars (p, val, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Paranoia - we probably do not need this. */
|
|
|
|
|
subseg_set (orig_seg, orig_subseg);
|
|
|
|
|
}
|