projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RISC-V: Fix lui argument parsing.
[deliverable/binutils-gdb.git]
/
gas
/
config
/
tc-bfin.c
diff --git
a/gas/config/tc-bfin.c
b/gas/config/tc-bfin.c
index 447a477de53c5f7df580ac74ebedc24ae3ade053..104ab6aec9e10e3a38f71d78d2b8c1a1dd5aa0bb 100644
(file)
--- a/
gas/config/tc-bfin.c
+++ b/
gas/config/tc-bfin.c
@@
-1,5
+1,5
@@
/* tc-bfin.c -- Assembler for the ADI Blackfin.
/* tc-bfin.c -- Assembler for the ADI Blackfin.
- Copyright (C) 2005-201
4
Free Software Foundation, Inc.
+ Copyright (C) 2005-201
9
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
This file is part of GAS, the GNU Assembler.
@@
-19,14
+19,12
@@
02110-1301, USA. */
#include "as.h"
02110-1301, USA. */
#include "as.h"
-#include "struc-symbol.h"
#include "bfin-defs.h"
#include "obstack.h"
#include "safe-ctype.h"
#ifdef OBJ_ELF
#include "dwarf2dbg.h"
#endif
#include "bfin-defs.h"
#include "obstack.h"
#include "safe-ctype.h"
#ifdef OBJ_ELF
#include "dwarf2dbg.h"
#endif
-#include "libbfd.h"
#include "elf/common.h"
#include "elf/bfin.h"
#include "elf/common.h"
#include "elf/bfin.h"
@@
-111,7
+109,7
@@
bfin_pic_ptr (int nbytes)
static void
bfin_s_bss (int ignore ATTRIBUTE_UNUSED)
{
static void
bfin_s_bss (int ignore ATTRIBUTE_UNUSED)
{
-
register
int temp;
+ int temp;
temp = get_absolute_expression ();
subseg_set (bss_section, (subsegT) temp);
temp = get_absolute_expression ();
subseg_set (bss_section, (subsegT) temp);
@@
-324,8
+322,6
@@
struct bfin_cpu bfin_cpus[] =
{"bf592", BFIN_CPU_BF592, 0x0001, AC_05000074},
{"bf592", BFIN_CPU_BF592, 0x0000, AC_05000074},
{"bf592", BFIN_CPU_BF592, 0x0001, AC_05000074},
{"bf592", BFIN_CPU_BF592, 0x0000, AC_05000074},
-
- {NULL, 0, 0, 0}
};
/* Define bfin-specific command-line options (there are none). */
};
/* Define bfin-specific command-line options (there are none). */
@@
-348,7
+344,7
@@
size_t md_longopts_size = sizeof (md_longopts);
int
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, c
onst c
har *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
{
switch (c)
{
@@
-357,23
+353,22
@@
md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
case OPTION_MCPU:
{
case OPTION_MCPU:
{
- const char *
p, *
q;
- int i;
+ const char *q;
+
unsigned
int i;
- i = 0;
- while ((p = bfin_cpus[i].name) != NULL)
+ for (i = 0; i < ARRAY_SIZE (bfin_cpus); i++)
{
{
+ const char *p = bfin_cpus[i].name;
if (strncmp (arg, p, strlen (p)) == 0)
break;
if (strncmp (arg, p, strlen (p)) == 0)
break;
- i++;
}
}
- if (
p == NULL
)
+ if (
i == ARRAY_SIZE (bfin_cpus)
)
as_fatal ("-mcpu=%s is not valid", arg);
bfin_cpu_type = bfin_cpus[i].type;
as_fatal ("-mcpu=%s is not valid", arg);
bfin_cpu_type = bfin_cpus[i].type;
- q = arg + strlen (
p
);
+ q = arg + strlen (
bfin_cpus[i].name
);
if (*q == '\0')
{
if (*q == '\0')
{
@@
-385,7
+380,8
@@
md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
else if (strcmp (q, "-any") == 0)
{
bfin_si_revision = 0xffff;
else if (strcmp (q, "-any") == 0)
{
bfin_si_revision = 0xffff;
- while (bfin_cpus[i].type == bfin_cpu_type)
+ while (i < ARRAY_SIZE (bfin_cpus)
+ && bfin_cpus[i].type == bfin_cpu_type)
{
bfin_anomaly_checks |= bfin_cpus[i].anomaly_checks;
i++;
{
bfin_anomaly_checks |= bfin_cpus[i].anomaly_checks;
i++;
@@
-408,11
+404,13
@@
md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
bfin_si_revision = (si_major << 8) | si_minor;
bfin_si_revision = (si_major << 8) | si_minor;
- while (bfin_cpus[i].type == bfin_cpu_type
+ while (i < ARRAY_SIZE (bfin_cpus)
+ && bfin_cpus[i].type == bfin_cpu_type
&& bfin_cpus[i].si_revision != bfin_si_revision)
i++;
&& bfin_cpus[i].si_revision != bfin_si_revision)
i++;
- if (bfin_cpus[i].type != bfin_cpu_type)
+ if (i == ARRAY_SIZE (bfin_cpus)
+ || bfin_cpus[i].type != bfin_cpu_type)
goto invalid_silicon_revision;
bfin_anomaly_checks |= bfin_cpus[i].anomaly_checks;
goto invalid_silicon_revision;
bfin_anomaly_checks |= bfin_cpus[i].anomaly_checks;
@@
-446,7
+444,7
@@
md_show_usage (FILE * stream)
/* Perform machine-specific initializations. */
void
/* Perform machine-specific initializations. */
void
-md_begin ()
+md_begin (
void
)
{
/* Set the ELF flags if desired. */
if (bfin_flags)
{
/* Set the ELF flags if desired. */
if (bfin_flags)
@@
-485,20
+483,18
@@
void
md_assemble (char *line)
{
char *toP = 0;
md_assemble (char *line)
{
char *toP = 0;
- extern char *current_inputline;
int size, insn_size;
struct bfin_insn *tmp_insn;
size_t len;
static size_t buffer_len = 0;
int size, insn_size;
struct bfin_insn *tmp_insn;
size_t len;
static size_t buffer_len = 0;
+ static char *current_inputline;
parse_state state;
len = strlen (line);
if (len + 2 > buffer_len)
{
parse_state state;
len = strlen (line);
if (len + 2 > buffer_len)
{
- if (buffer_len > 0)
- free (current_inputline);
buffer_len = len + 40;
buffer_len = len + 40;
- current_inputline =
xmalloc (
buffer_len);
+ current_inputline =
XRESIZEVEC (char, current_inputline,
buffer_len);
}
memcpy (current_inputline, line, len);
current_inputline[len] = ';';
}
memcpy (current_inputline, line, len);
current_inputline[len] = ';';
@@
-791,16
+787,14
@@
md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
/* Round up a section size to the appropriate boundary. */
valueT
/* Round up a section size to the appropriate boundary. */
valueT
-md_section_align (segment, size)
- segT segment;
- valueT size;
+md_section_align (segT segment, valueT size)
{
int boundary = bfd_get_section_alignment (stdoutput, segment);
{
int boundary = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << boundary) - 1) &
(-
1 << boundary));
+ return ((size + (1 << boundary) - 1) &
-(
1 << boundary));
}
}
-char *
+c
onst c
har *
md_atof (int type, char * litP, int * sizeP)
{
return ieee_md_atof (type, litP, sizeP, FALSE);
md_atof (int type, char * litP, int * sizeP)
{
return ieee_md_atof (type, litP, sizeP, FALSE);
@@
-811,14
+805,12
@@
md_atof (int type, char * litP, int * sizeP)
then it is done here. */
arelent *
then it is done here. */
arelent *
-tc_gen_reloc (seg, fixp)
- asection *seg ATTRIBUTE_UNUSED;
- fixS *fixp;
+tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
{
arelent *reloc;
{
arelent *reloc;
- reloc =
(arelent *) xmalloc (sizeof (arelent)
);
- reloc->sym_ptr_ptr =
(asymbol **) xmalloc (sizeof (asymbol *)
);
+ reloc =
XNEW (arelent
);
+ reloc->sym_ptr_ptr =
XNEW (asymbol *
);
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
@@
-844,9
+836,7
@@
tc_gen_reloc (seg, fixp)
given a PC relative reloc. */
long
given a PC relative reloc. */
long
-md_pcrel_from_section (fixP, sec)
- fixS *fixP;
- segT sec;
+md_pcrel_from_section (fixS *fixP, segT sec)
{
if (fixP->fx_addsy != (symbolS *) NULL
&& (!S_IS_DEFINED (fixP->fx_addsy)
{
if (fixP->fx_addsy != (symbolS *) NULL
&& (!S_IS_DEFINED (fixP->fx_addsy)
@@
-937,7
+927,7
@@
note_reloc2 (INSTR_T code, const char *symbol, int reloc, int value, int pcrel)
INSTR_T
gencode (unsigned long x)
{
INSTR_T
gencode (unsigned long x)
{
- INSTR_T cell =
obstack_alloc (&mempool, sizeof (struct bfin_insn)
);
+ INSTR_T cell =
XOBNEW (&mempool, struct bfin_insn
);
memset (cell, 0, sizeof (struct bfin_insn));
cell->value = (x);
return cell;
memset (cell, 0, sizeof (struct bfin_insn));
cell->value = (x);
return cell;
@@
-977,13
+967,13
@@
INSTR_T Expr_Node_Gen_Reloc (Expr_Node *head, int parent_reloc);
INSTR_T
Expr_Node_Gen_Reloc (Expr_Node * head, int parent_reloc)
{
INSTR_T
Expr_Node_Gen_Reloc (Expr_Node * head, int parent_reloc)
{
- /* Top level reloction expression generator VDSP style.
+ /* Top level reloc
a
tion expression generator VDSP style.
If the relocation is just by itself, generate one item
else generate this convoluted expression. */
INSTR_T note = NULL_CODE;
INSTR_T note1 = NULL_CODE;
If the relocation is just by itself, generate one item
else generate this convoluted expression. */
INSTR_T note = NULL_CODE;
INSTR_T note1 = NULL_CODE;
- int pcrel = 1; /* Is the parent reloc pcrelative?
+ int pcrel = 1; /* Is the parent reloc pc
-
relative?
This calculation here and HOWTO should match. */
if (parent_reloc)
This calculation here and HOWTO should match. */
if (parent_reloc)
@@
-1939,7
+1929,7
@@
bfin_loop_beginend (Expr_Node *exp, int begin)
/* LOOP_END follows the last instruction in the loop.
Adjust label address. */
if (!begin)
/* LOOP_END follows the last instruction in the loop.
Adjust label address. */
if (!begin)
-
((struct local_symbol *) linelabel)->lsy_value
-= last_insn_size;
+
*symbol_X_add_number (linelabel)
-= last_insn_size;
}
bfd_boolean
}
bfd_boolean
@@
-1970,9
+1960,9
@@
bfin_eol_in_insn (char *line)
}
bfd_boolean
}
bfd_boolean
-bfin_start_label (char *s
, char *ptr
)
+bfin_start_label (char *s)
{
{
- while (
s != ptr
)
+ while (
*s != 0
)
{
if (*s == '(' || *s == '[')
return FALSE;
{
if (*s == '(' || *s == '[')
return FALSE;
This page took
0.026328 seconds
and
4
git commands to generate.