mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 14:39:09 +08:00
Fix formatting.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2000-07-07 Kazu Hirata <kazu@hxi.com>
|
||||||
|
|
||||||
|
* config/tc-sh.c: Fix formatting.
|
||||||
|
|
||||||
2000-07-06 Mark Elbrecht <snowball3@bigfoot.com>
|
2000-07-06 Mark Elbrecht <snowball3@bigfoot.com>
|
||||||
|
|
||||||
* config/obj-coff.c (TC_COFF_SECTION_DEFAULT_ATTRIBUTES): New.
|
* config/obj-coff.c (TC_COFF_SECTION_DEFAULT_ATTRIBUTES): New.
|
||||||
|
@ -18,10 +18,7 @@
|
|||||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
/*
|
/* Written By Steve Chamberlain <sac@cygnus.com> */
|
||||||
Written By Steve Chamberlain
|
|
||||||
sac@cygnus.com
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "as.h"
|
#include "as.h"
|
||||||
@ -65,8 +62,7 @@ little (ignore)
|
|||||||
has to support. The fields are:
|
has to support. The fields are:
|
||||||
pseudo-op name without dot
|
pseudo-op name without dot
|
||||||
function to call to execute this pseudo-op
|
function to call to execute this pseudo-op
|
||||||
Integer arg to pass to the function
|
Integer arg to pass to the function. */
|
||||||
*/
|
|
||||||
|
|
||||||
const pseudo_typeS md_pseudo_table[] =
|
const pseudo_typeS md_pseudo_table[] =
|
||||||
{
|
{
|
||||||
@ -102,7 +98,7 @@ static int valid_arch;
|
|||||||
|
|
||||||
const char EXP_CHARS[] = "eE";
|
const char EXP_CHARS[] = "eE";
|
||||||
|
|
||||||
/* Chars that mean this number is a floating point constant */
|
/* Chars that mean this number is a floating point constant. */
|
||||||
/* As in 0f12.456 */
|
/* As in 0f12.456 */
|
||||||
/* or 0d1.2345e12 */
|
/* or 0d1.2345e12 */
|
||||||
const char FLT_CHARS[] = "rRsSfFdDxXpP";
|
const char FLT_CHARS[] = "rRsSfFdDxXpP";
|
||||||
@ -113,7 +109,7 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP";
|
|||||||
#define ENCODE_RELAX(what,length) (((what) << 4) + (length))
|
#define ENCODE_RELAX(what,length) (((what) << 4) + (length))
|
||||||
#define GET_WHAT(x) ((x>>4))
|
#define GET_WHAT(x) ((x>>4))
|
||||||
|
|
||||||
/* These are the three types of relaxable instrction */
|
/* These are the three types of relaxable instrction. */
|
||||||
#define COND_JUMP 1
|
#define COND_JUMP 1
|
||||||
#define COND_JUMP_DELAY 2
|
#define COND_JUMP_DELAY 2
|
||||||
#define UNCOND_JUMP 3
|
#define UNCOND_JUMP 3
|
||||||
@ -199,10 +195,8 @@ const relax_typeS md_relax_table[C (END, 0)] = {
|
|||||||
|
|
||||||
static struct hash_control *opcode_hash_control; /* Opcode mnemonics */
|
static struct hash_control *opcode_hash_control; /* Opcode mnemonics */
|
||||||
|
|
||||||
/*
|
/* This function is called once, at assembler startup time. This should
|
||||||
This function is called once, at assembler startup time. This should
|
set up all the tables, etc that the MD part of the assembler needs. */
|
||||||
set up all the tables, etc that the MD part of the assembler needs
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
void
|
||||||
md_begin ()
|
md_begin ()
|
||||||
@ -224,7 +218,7 @@ md_begin ()
|
|||||||
|
|
||||||
opcode_hash_control = hash_new ();
|
opcode_hash_control = hash_new ();
|
||||||
|
|
||||||
/* Insert unique names into hash table */
|
/* Insert unique names into hash table. */
|
||||||
for (opcode = sh_table; opcode->name; opcode++)
|
for (opcode = sh_table; opcode->name; opcode++)
|
||||||
{
|
{
|
||||||
if (strcmp (prev_name, opcode->name))
|
if (strcmp (prev_name, opcode->name))
|
||||||
@ -237,7 +231,7 @@ md_begin ()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Make all the opcodes with the same name point to the same
|
/* Make all the opcodes with the same name point to the same
|
||||||
string */
|
string. */
|
||||||
opcode->name = prev_name;
|
opcode->name = prev_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -259,7 +253,8 @@ sh_operand_info;
|
|||||||
|
|
||||||
#define IDENT_CHAR(c) (isalnum (c) || (c) == '_')
|
#define IDENT_CHAR(c) (isalnum (c) || (c) == '_')
|
||||||
|
|
||||||
/* try and parse a reg name, returns number of chars consumed */
|
/* Try to parse a reg name. Return the number of chars consumed. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
parse_reg (src, mode, reg)
|
parse_reg (src, mode, reg)
|
||||||
char *src;
|
char *src;
|
||||||
@ -673,7 +668,7 @@ parse_at (src, op)
|
|||||||
src++;
|
src++;
|
||||||
if (src[0] == '-')
|
if (src[0] == '-')
|
||||||
{
|
{
|
||||||
/* Must be predecrement */
|
/* Must be predecrement. */
|
||||||
src++;
|
src++;
|
||||||
|
|
||||||
len = parse_reg (src, &mode, &(op->reg));
|
len = parse_reg (src, &mode, &(op->reg));
|
||||||
@ -820,7 +815,7 @@ get_operand (ptr, op)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Not a reg, the only thing left is a displacement */
|
/* Not a reg, the only thing left is a displacement. */
|
||||||
*ptr = parse_exp (src, op);
|
*ptr = parse_exp (src, op);
|
||||||
op->type = A_DISP_PC;
|
op->type = A_DISP_PC;
|
||||||
return;
|
return;
|
||||||
@ -887,8 +882,7 @@ get_operands (info, args, operand)
|
|||||||
|
|
||||||
/* Passed a pointer to a list of opcodes which use different
|
/* Passed a pointer to a list of opcodes which use different
|
||||||
addressing modes, return the opcode which matches the opcodes
|
addressing modes, return the opcode which matches the opcodes
|
||||||
provided
|
provided. */
|
||||||
*/
|
|
||||||
|
|
||||||
static
|
static
|
||||||
sh_opcode_info *
|
sh_opcode_info *
|
||||||
@ -905,18 +899,19 @@ get_specific (opcode, operands)
|
|||||||
if (this_try->name != name)
|
if (this_try->name != name)
|
||||||
{
|
{
|
||||||
/* We've looked so far down the table that we've run out of
|
/* We've looked so far down the table that we've run out of
|
||||||
opcodes with the same name */
|
opcodes with the same name. */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* look at both operands needed by the opcodes and provided by
|
|
||||||
|
/* Look at both operands needed by the opcodes and provided by
|
||||||
the user - since an arg test will often fail on the same arg
|
the user - since an arg test will often fail on the same arg
|
||||||
again and again, we'll try and test the last failing arg the
|
again and again, we'll try and test the last failing arg the
|
||||||
first on each opcode try */
|
first on each opcode try. */
|
||||||
|
|
||||||
for (n = 0; this_try->arg[n]; n++)
|
for (n = 0; this_try->arg[n]; n++)
|
||||||
{
|
{
|
||||||
sh_operand_info *user = operands + n;
|
sh_operand_info *user = operands + n;
|
||||||
sh_arg_type arg = this_try->arg[n];
|
sh_arg_type arg = this_try->arg[n];
|
||||||
|
|
||||||
switch (arg)
|
switch (arg)
|
||||||
{
|
{
|
||||||
case A_IMM:
|
case A_IMM:
|
||||||
@ -1236,7 +1231,7 @@ build_relax (opcode, op)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* insert ldrs & ldre with fancy relocations that relaxation can recognize. */
|
/* Insert ldrs & ldre with fancy relocations that relaxation can recognize. */
|
||||||
static char *
|
static char *
|
||||||
insert_loop_bounds (output, operand)
|
insert_loop_bounds (output, operand)
|
||||||
char *output;
|
char *output;
|
||||||
@ -1286,6 +1281,7 @@ insert_loop_bounds (output, operand)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now we know what sort of opcodes it is, lets build the bytes. */
|
/* Now we know what sort of opcodes it is, lets build the bytes. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
build_Mytes (opcode, operand)
|
build_Mytes (opcode, operand)
|
||||||
sh_opcode_info *opcode;
|
sh_opcode_info *opcode;
|
||||||
@ -1403,7 +1399,8 @@ find_cooked_opcode (str_p)
|
|||||||
unsigned char *op_end;
|
unsigned char *op_end;
|
||||||
char name[20];
|
char name[20];
|
||||||
int nlen = 0;
|
int nlen = 0;
|
||||||
/* Drop leading whitespace */
|
|
||||||
|
/* Drop leading whitespace. */
|
||||||
while (*str == ' ')
|
while (*str == ' ')
|
||||||
str++;
|
str++;
|
||||||
|
|
||||||
@ -1428,19 +1425,19 @@ find_cooked_opcode (str_p)
|
|||||||
name[nlen] = c;
|
name[nlen] = c;
|
||||||
nlen++;
|
nlen++;
|
||||||
}
|
}
|
||||||
|
|
||||||
name[nlen] = 0;
|
name[nlen] = 0;
|
||||||
*str_p = op_end;
|
*str_p = op_end;
|
||||||
|
|
||||||
if (nlen == 0)
|
if (nlen == 0)
|
||||||
{
|
|
||||||
as_bad (_("can't find opcode "));
|
as_bad (_("can't find opcode "));
|
||||||
}
|
|
||||||
|
|
||||||
return (sh_opcode_info *) hash_find (opcode_hash_control, name);
|
return (sh_opcode_info *) hash_find (opcode_hash_control, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Assemble a parallel processing insn. */
|
/* Assemble a parallel processing insn. */
|
||||||
#define DDT_BASE 0xf000 /* Base value for double data transfer insns */
|
#define DDT_BASE 0xf000 /* Base value for double data transfer insns */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
assemble_ppi (op_end, opcode)
|
assemble_ppi (op_end, opcode)
|
||||||
char *op_end;
|
char *op_end;
|
||||||
@ -1467,7 +1464,7 @@ assemble_ppi (op_end, opcode)
|
|||||||
opcode = get_specific (opcode, operand);
|
opcode = get_specific (opcode, operand);
|
||||||
if (opcode == 0)
|
if (opcode == 0)
|
||||||
{
|
{
|
||||||
/* Couldn't find an opcode which matched the operands */
|
/* Couldn't find an opcode which matched the operands. */
|
||||||
char *where = frag_more (2);
|
char *where = frag_more (2);
|
||||||
|
|
||||||
where[0] = 0x0;
|
where[0] = 0x0;
|
||||||
@ -1475,6 +1472,7 @@ assemble_ppi (op_end, opcode)
|
|||||||
as_bad (_("invalid operands for opcode"));
|
as_bad (_("invalid operands for opcode"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opcode->nibbles[0] != PPI)
|
if (opcode->nibbles[0] != PPI)
|
||||||
as_bad (_("insn can't be combined with parallel processing insn"));
|
as_bad (_("insn can't be combined with parallel processing insn"));
|
||||||
|
|
||||||
@ -1646,8 +1644,7 @@ assemble_ppi (op_end, opcode)
|
|||||||
|
|
||||||
/* This is the guts of the machine-dependent assembler. STR points to a
|
/* This is the guts of the machine-dependent assembler. STR points to a
|
||||||
machine dependent instruction. This function is supposed to emit
|
machine dependent instruction. This function is supposed to emit
|
||||||
the frags/bytes it assembles to.
|
the frags/bytes it assembles to. */
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
void
|
||||||
md_assemble (str)
|
md_assemble (str)
|
||||||
@ -1705,7 +1702,7 @@ md_assemble (str)
|
|||||||
|
|
||||||
if (opcode == 0)
|
if (opcode == 0)
|
||||||
{
|
{
|
||||||
/* Couldn't find an opcode which matched the operands */
|
/* Couldn't find an opcode which matched the operands. */
|
||||||
char *where = frag_more (2);
|
char *where = frag_more (2);
|
||||||
|
|
||||||
where[0] = 0x0;
|
where[0] = 0x0;
|
||||||
@ -1789,14 +1786,15 @@ tc_headers_hook (headers)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Various routines to kill one day */
|
/* Various routines to kill one day. */
|
||||||
/* Equal to MAX_PRECISION in atof-ieee.c */
|
/* Equal to MAX_PRECISION in atof-ieee.c. */
|
||||||
#define MAX_LITTLENUMS 6
|
#define MAX_LITTLENUMS 6
|
||||||
|
|
||||||
/* Turn a string in input_line_pointer into a floating point constant of type
|
/* Turn a string in input_line_pointer into a floating point constant
|
||||||
type, and store the appropriate bytes in *litP. The number of LITTLENUMS
|
of type TYPE, and store the appropriate bytes in *LITP. The number
|
||||||
emitted is stored in *sizeP . An error message is returned, or NULL on OK.
|
of LITTLENUMS emitted is stored in *SIZEP . An error message is
|
||||||
*/
|
returned, or NULL on OK. */
|
||||||
|
|
||||||
char *
|
char *
|
||||||
md_atof (type, litP, sizeP)
|
md_atof (type, litP, sizeP)
|
||||||
int type;
|
int type;
|
||||||
@ -1878,8 +1876,8 @@ s_uses (ignore)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CONST char *md_shortopts = "";
|
CONST char *md_shortopts = "";
|
||||||
struct option md_longopts[] = {
|
struct option md_longopts[] =
|
||||||
|
{
|
||||||
#define OPTION_RELAX (OPTION_MD_BASE)
|
#define OPTION_RELAX (OPTION_MD_BASE)
|
||||||
#define OPTION_LITTLE (OPTION_MD_BASE + 1)
|
#define OPTION_LITTLE (OPTION_MD_BASE + 1)
|
||||||
#define OPTION_SMALL (OPTION_LITTLE + 1)
|
#define OPTION_SMALL (OPTION_LITTLE + 1)
|
||||||
@ -2054,8 +2052,8 @@ sh_frob_section (abfd, sec, ignore)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fscan should also be a fixup to a local symbol in the same
|
/* The variable fscan should also be a fixup to a local symbol
|
||||||
section. */
|
in the same section. */
|
||||||
sym = fscan->fx_addsy;
|
sym = fscan->fx_addsy;
|
||||||
if (sym == NULL
|
if (sym == NULL
|
||||||
|| fscan->fx_subsy != NULL
|
|| fscan->fx_subsy != NULL
|
||||||
@ -2202,7 +2200,7 @@ md_convert_frag (headers, seg, fragP)
|
|||||||
buffer[highbyte+10] = 0x20; /* build nop */
|
buffer[highbyte+10] = 0x20; /* build nop */
|
||||||
buffer[lowbyte+10] = 0x0b;
|
buffer[lowbyte+10] = 0x0b;
|
||||||
|
|
||||||
/* Make reloc for the long disp */
|
/* Make reloc for the long disp. */
|
||||||
fix_new (fragP,
|
fix_new (fragP,
|
||||||
fragP->fr_fix + 4,
|
fragP->fr_fix + 4,
|
||||||
4,
|
4,
|
||||||
@ -2219,7 +2217,7 @@ md_convert_frag (headers, seg, fragP)
|
|||||||
|
|
||||||
case C (COND_JUMP, COND12):
|
case C (COND_JUMP, COND12):
|
||||||
case C (COND_JUMP_DELAY, COND12):
|
case C (COND_JUMP_DELAY, COND12):
|
||||||
/* A bcond won't fit, so turn it into a b!cond; bra disp; nop */
|
/* A bcond won't fit, so turn it into a b!cond; bra disp; nop. */
|
||||||
/* I found that a relax failure for gcc.c-torture/execute/930628-1.c
|
/* I found that a relax failure for gcc.c-torture/execute/930628-1.c
|
||||||
was due to gas incorrectly relaxing an out-of-range conditional
|
was due to gas incorrectly relaxing an out-of-range conditional
|
||||||
branch with delay slot. It turned:
|
branch with delay slot. It turned:
|
||||||
@ -2522,7 +2520,8 @@ sh_fix_adjustable (fixP)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sh_elf_final_processing()
|
void
|
||||||
|
sh_elf_final_processing ()
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
@ -2574,9 +2573,9 @@ md_apply_fix (fixP, val)
|
|||||||
int shift;
|
int shift;
|
||||||
|
|
||||||
#ifdef BFD_ASSEMBLER
|
#ifdef BFD_ASSEMBLER
|
||||||
/* adjust_reloc_syms won't convert a reloc against a weak symbol
|
/* The function adjust_reloc_syms won't convert a reloc against a weak
|
||||||
into a reloc against a section, but bfd_install_relocation will
|
symbol into a reloc against a section, but bfd_install_relocation
|
||||||
screw up if the symbol is defined, so we have to adjust val here
|
will screw up if the symbol is defined, so we have to adjust val here
|
||||||
to avoid the screw up later. */
|
to avoid the screw up later. */
|
||||||
if (fixP->fx_addsy != NULL
|
if (fixP->fx_addsy != NULL
|
||||||
&& S_IS_WEAK (fixP->fx_addsy))
|
&& S_IS_WEAK (fixP->fx_addsy))
|
||||||
@ -2771,7 +2770,7 @@ md_estimate_size_before_relax (fragP, segment_type)
|
|||||||
switch (fragP->fr_subtype)
|
switch (fragP->fr_subtype)
|
||||||
{
|
{
|
||||||
case C (UNCOND_JUMP, UNDEF_DISP):
|
case C (UNCOND_JUMP, UNDEF_DISP):
|
||||||
/* used to be a branch to somewhere which was unknown */
|
/* Used to be a branch to somewhere which was unknown. */
|
||||||
if (!fragP->fr_symbol)
|
if (!fragP->fr_symbol)
|
||||||
{
|
{
|
||||||
fragP->fr_subtype = C (UNCOND_JUMP, UNCOND12);
|
fragP->fr_subtype = C (UNCOND_JUMP, UNCOND12);
|
||||||
@ -2794,20 +2793,20 @@ md_estimate_size_before_relax (fragP, segment_type)
|
|||||||
abort ();
|
abort ();
|
||||||
case C (COND_JUMP, UNDEF_DISP):
|
case C (COND_JUMP, UNDEF_DISP):
|
||||||
case C (COND_JUMP_DELAY, UNDEF_DISP):
|
case C (COND_JUMP_DELAY, UNDEF_DISP):
|
||||||
/* used to be a branch to somewhere which was unknown */
|
/* Used to be a branch to somewhere which was unknown. */
|
||||||
if (fragP->fr_symbol
|
if (fragP->fr_symbol
|
||||||
&& S_GET_SEGMENT (fragP->fr_symbol) == segment_type)
|
&& S_GET_SEGMENT (fragP->fr_symbol) == segment_type)
|
||||||
{
|
{
|
||||||
int what = GET_WHAT (fragP->fr_subtype);
|
int what = GET_WHAT (fragP->fr_subtype);
|
||||||
/* Got a symbol and it's defined in this segment, become byte
|
/* Got a symbol and it's defined in this segment, become byte
|
||||||
sized - maybe it will fix up */
|
sized - maybe it will fix up. */
|
||||||
fragP->fr_subtype = C (what, COND8);
|
fragP->fr_subtype = C (what, COND8);
|
||||||
fragP->fr_var = md_relax_table[C (what, COND8)].rlx_length;
|
fragP->fr_var = md_relax_table[C (what, COND8)].rlx_length;
|
||||||
}
|
}
|
||||||
else if (fragP->fr_symbol)
|
else if (fragP->fr_symbol)
|
||||||
{
|
{
|
||||||
int what = GET_WHAT (fragP->fr_subtype);
|
int what = GET_WHAT (fragP->fr_subtype);
|
||||||
/* Its got a segment, but its not ours, so it will always be long */
|
/* Its got a segment, but its not ours, so it will always be long. */
|
||||||
fragP->fr_subtype = C (what, UNDEF_WORD_DISP);
|
fragP->fr_subtype = C (what, UNDEF_WORD_DISP);
|
||||||
fragP->fr_var = md_relax_table[C (what, COND32)].rlx_length;
|
fragP->fr_var = md_relax_table[C (what, COND32)].rlx_length;
|
||||||
return md_relax_table[C (what, COND32)].rlx_length;
|
return md_relax_table[C (what, COND32)].rlx_length;
|
||||||
@ -2815,7 +2814,7 @@ md_estimate_size_before_relax (fragP, segment_type)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int what = GET_WHAT (fragP->fr_subtype);
|
int what = GET_WHAT (fragP->fr_subtype);
|
||||||
/* We know the abs value */
|
/* We know the abs value. */
|
||||||
fragP->fr_subtype = C (what, COND8);
|
fragP->fr_subtype = C (what, COND8);
|
||||||
fragP->fr_var = md_relax_table[C (what, COND8)].rlx_length;
|
fragP->fr_var = md_relax_table[C (what, COND8)].rlx_length;
|
||||||
}
|
}
|
||||||
@ -2825,7 +2824,7 @@ md_estimate_size_before_relax (fragP, segment_type)
|
|||||||
return fragP->fr_var;
|
return fragP->fr_var;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put number into target byte order */
|
/* Put number into target byte order. */
|
||||||
|
|
||||||
void
|
void
|
||||||
md_number_to_chars (ptr, use, nbytes)
|
md_number_to_chars (ptr, use, nbytes)
|
||||||
|
Reference in New Issue
Block a user