Updated sources to avoid using the identifier name "new", which is a

keyword in c++.

        * bfd/aoutx.h (NAME (aout, make_empty_symbol)): Rename variable
        new to new_symbol.
        * bfd/coffgen.c (coff_make_empty_symbol)
        (coff_bfd_make_debug_symbol): Rename variable new to new_symbol.
        * bfd/cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable
        new to new_insn.
        * bfd/doc/chew.c (newentry, add_intrinsic): Rename variable new to
        new_d.
        * bfd/ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new
        to new_symbol.
        * bfd/elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument
        new to new_reloc.
        * bfd/hash.c (bfd_hash_lookup): Rename variable new to new_string.
        * bfd/ieee.c (ieee_make_empty_symbol): Rename variable new to
        new_symbol.
        * bfd/linker.c (bfd_new_link_order): Rename variable new to
        new_lo.
        * bfd/mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to
        symbol.
        * bfd/oasys.c (oasys_make_empty_symbol): Rename variable new to
        new_symbol_type.
        * bfd/pdp11.c (NAME (aout, make_empty_symbol)): Rename variable
        new to new_symbol_type.
        * bfd/plugin.c (bfd_plugin_make_empty_symbol): Rename variable new
        to new_symbol.
        * bfd/rs6000-core.c (CoreHdr, VmInfo): Rename union member new to
        new_dump.
        (read_hdr, rs6000coff_core_p)
        (rs6000coff_core_file_matches_executable_p)
        (rs6000coff_core_file_failing_command)
        (rs6000coff_core_file_failing_signal): Updated function to use new
        union member name.
        * bfd/som.c (som_make_empty_symbol): Rename variable new to
        new_symbol_type.
        * bfd/syms.c (_bfd_generic_make_empty_symbol): Rename variable new
        to new_symbol.
        * bfd/tekhex.c (first_phase, tekhex_make_empty_symbol): Rename
        variable new to new_symbol.
        * binutils/nlmconv.c (main): Rename variable new to new_name.
        * gas/config/tc-arm.c (insert_reg_alias): Rename variable new to
        new_reg.
        * gas/config/tc-dlx.c (parse_operand): Rename variable new to
        new_pos.
        * gas/config/tc-ia64.c (ia64_gen_real_reloc_type): Rename variable
        new to newr.
        * gas/config/tc-mcore.c (parse_exp, parse_imm): Rename variable
        new to new_pointer.
        * gas/config/tc-microblaze.c (parse_exp, parse_imm, check_got):
        Change name from new to new_pointer.
        * gas/config/tc-or32.c (parse_operand): Rename variable new to
        new_pointer.
        * gas/config/tc-pdp11.c (md_assemble): Rename variable new to
        new_pointer.
        * gas/config/tc-pj.c (alias): Change argument new to new_name.
        * gas/config/tc-score.c (s3_build_score_ops_hsh): Rename variable
        new to new_opcode. (s3_build_dependency_insn_hsh) Rename variable
        new to new_i2n. (s3_convert): Rename variables old and new to
        r_old and r_new.
        * gas/config/tc-score7.c (s7_build_score_ops_hsh): Rename variable
        new to new_opcode. (s7_build_dependency_insn_hsh): Rename variable
        new to new_i2d. (s7_b32_relax_to_b16, s7_convert_frag): Rename
        variables old and new to r_old and r_new.
        * gas/config/tc-sh.c (parse_exp): Rename variable new to
        new_pointer.
        * gas/config/tc-sh64.c (shmedia_parse_exp): Rename variable new to
        new_pointer.
        * gas/config/tc-tic4x.c (tic4x_operand_parse): Rename variable new
        to new_pointer.
        * gas/config/tc-z8k.c (parse_exp): Rename variable new to
        new_pointer.
        * gas/listing.c (listing_newline): Rename variable new to new_i.
        * ld/ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop)
        (exp_trinop, exp_unop, exp_nameop, exp_assop): Rename variable new
        to new_e.
        * ld/ldfile.c (ldfile_add_library_path): Rename variable new to
        new_dirs. (ldfile_add_arch): Rename variable new to new_arch.
        * ld/ldlang.c (new_statement, lang_final, lang_add_wild)
        (lang_target, lang_add_fill, lang_add_data, lang_add_assignment)
        (lang_add_insert): Rename variable new to new_stmt. (new_afile):
        Added missing cast. (lang_memory_region_lookup): Rename variable
        new to new_region. (init_os): Rename variable new to
        new_userdata. (lang_add_section): Rename variable new to
        new_section. (ldlang_add_undef): Rename variable new to
        new_undef. (realsymbol): Rename variable new to new_name.
        * opcodes/z8kgen.c (internal, gas): Rename variable new to new_op.

        Updated sources to avoid using the identifier name "template",
        which is a keyword in c++.

        * bfd/elf32-arm.c (struct stub_def): Rename member template to
        template_sequence. (arm_build_one_stub,
        find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub):
        Rename variable template to template_sequence.
        * bfd/elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl):
        Rename variable template to template_val.
        * gas/config/tc-arm.c (struct asm_cond, struct asm_psr, struct
        asm_barrier_opt): Change member template to
        template_name. (md_begin): Update code to reflect new member
        names.
        * gas/config/tc-i386.c (struct templates, struct _i386_insn)
        (match_template, cpu_flags_match, match_reg_size, match_mem_size)
        (operand_size_match, md_begin, i386_print_statistics, pi)
        (build_vex_prefix, md_assemble, parse_insn, optimize_imm)
        (optimize_disp): Updated code to use new names. (parse_insn):
        Added casts.
        * gas/config/tc-ia64.c (dot_template, emit_one_bundle): Updated
        code to use new names.
        * gas/config/tc-score.c (struct s3_asm_opcode): Renamed member
        template to template_name. (s3_parse_16_32_inst, s3_parse_48_inst,
        s3_do_macro_ldst_label, s3_build_score_ops_hsh): Update code to
        use new names.
        * gas/config/tc-score7.c (struct s7_asm_opcode): Renamed member
        template to template_name. (s7_parse_16_32_inst,
        s7_do_macro_ldst_label, s7_build_score_ops_hsh): Update code to
        use new names.
        * gas/config/tc-tic30.c (md_begin, struct tic30_insn)
        (md_assemble): Update code to use new names.
        * gas/config/tc-tic54x.c (struct _tic54x_insn, md_begin)
        (optimize_insn, tic54x_parse_insn, next_line_shows_parallel):
        Update code to use new names.
        * include/opcode/tic30.h (template): Rename type template to
        insn_template. Updated code to use new name.
        * include/opcode/tic54x.h (template): Rename type template to
        insn_template.
        * opcodes/cris-dis.c (bytes_to_skip): Update code to use new name.
        * opcodes/i386-dis.c (putop): Update code to use new name.
        * opcodes/i386-gen.c (process_i386_opcodes): Update code to use
        new name.
        * opcodes/i386-opc.h (struct template): Rename struct template to
        insn_template. Update code accordingly.
        * opcodes/i386-tbl.h (i386_optab): Update type to use new name.
        * opcodes/ia64-dis.c (print_insn_ia64): Rename variable template
        to template_val.
        * opcodes/tic30-dis.c (struct instruction, get_tic30_instruction):
        Update code to use new name.
        * opcodes/tic54x-dis.c (has_lkaddr, get_insn_size)
        (print_parallel_instruction, print_insn_tic54x, tic54x_get_insn):
        Update code to use new name.
        * opcodes/tic54x-opc.c (tic54x_unknown_opcode, tic54x_optab):
        Update type to new name.
This commit is contained in:
Nick Clifton 2009-08-29 22:11:02 +00:00
parent 0aec8eb1b5
commit d3ce72d070
63 changed files with 907 additions and 683 deletions

View File

@ -1,3 +1,48 @@
2009-08-29 Martin Thuresson <martin@mtme.org>
* elf32-arm.c (struct stub_def): Rename member template to
template_sequence. (arm_build_one_stub,
find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub):
Rename variable template to template_sequence.
* elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl):
Rename variable template to template_val.
* aoutx.h (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol.
* coffgen.c (coff_make_empty_symbol)
(coff_bfd_make_debug_symbol): Rename variable new to new_symbol.
* cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable
new to new_insn.
* ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new
to new_symbol.
* elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument
new to new_reloc.
* hash.c (bfd_hash_lookup): Rename variable new to new_string.
* ieee.c (ieee_make_empty_symbol): Rename variable new to
new_symbol.
* linker.c (bfd_new_link_order): Rename variable new to
new_lo.
* mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to
symbol.
* oasys.c (oasys_make_empty_symbol): Rename variable new to
new_symbol_type.
* pdp11.c (NAME (aout, make_empty_symbol)): Rename variable
new to new_symbol_type.
* plugin.c (bfd_plugin_make_empty_symbol): Rename variable new
to new_symbol.
* rs6000-core.c (CoreHdr, VmInfo): Rename union member new to
new_dump.
(read_hdr, rs6000coff_core_p)
(rs6000coff_core_file_matches_executable_p)
(rs6000coff_core_file_failing_command)
(rs6000coff_core_file_failing_signal): Updated function to use new
union member name.
* som.c (som_make_empty_symbol): Rename variable new to
new_symbol_type.
* syms.c (_bfd_generic_make_empty_symbol): Rename variable new
to new_symbol.
* tekhex.c (first_phase, tekhex_make_empty_symbol): Rename
variable new to new_symbol.
2009-08-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 2009-08-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* acinclude.m4 (AM_INSTALL_LIBBFD): Call AM_SUBST_NOTMAKE for * acinclude.m4 (AM_INSTALL_LIBBFD): Call AM_SUBST_NOTMAKE for

View File

@ -1668,12 +1668,12 @@ NAME (aout, make_empty_symbol) (bfd *abfd)
{ {
bfd_size_type amt = sizeof (aout_symbol_type); bfd_size_type amt = sizeof (aout_symbol_type);
aout_symbol_type *new = bfd_zalloc (abfd, amt); aout_symbol_type *new_symbol = (aout_symbol_type *) bfd_zalloc (abfd, amt);
if (!new) if (!new_symbol)
return NULL; return NULL;
new->symbol.the_bfd = abfd; new_symbol->symbol.the_bfd = abfd;
return &new->symbol; return &new_symbol->symbol;
} }
/* Translate a set of internal symbols into external symbols. */ /* Translate a set of internal symbols into external symbols. */

View File

@ -1794,17 +1794,17 @@ asymbol *
coff_make_empty_symbol (bfd *abfd) coff_make_empty_symbol (bfd *abfd)
{ {
bfd_size_type amt = sizeof (coff_symbol_type); bfd_size_type amt = sizeof (coff_symbol_type);
coff_symbol_type *new = bfd_zalloc (abfd, amt); coff_symbol_type *new_symbol = (coff_symbol_type *) bfd_zalloc (abfd, amt);
if (new == NULL) if (new_symbol == NULL)
return NULL; return NULL;
new->symbol.section = 0; new_symbol->symbol.section = 0;
new->native = 0; new_symbol->native = 0;
new->lineno = NULL; new_symbol->lineno = NULL;
new->done_lineno = FALSE; new_symbol->done_lineno = FALSE;
new->symbol.the_bfd = abfd; new_symbol->symbol.the_bfd = abfd;
return & new->symbol; return & new_symbol->symbol;
} }
/* Make a debugging symbol. */ /* Make a debugging symbol. */
@ -1815,23 +1815,23 @@ coff_bfd_make_debug_symbol (bfd *abfd,
unsigned long sz ATTRIBUTE_UNUSED) unsigned long sz ATTRIBUTE_UNUSED)
{ {
bfd_size_type amt = sizeof (coff_symbol_type); bfd_size_type amt = sizeof (coff_symbol_type);
coff_symbol_type *new = bfd_alloc (abfd, amt); coff_symbol_type *new_symbol = (coff_symbol_type *) bfd_alloc (abfd, amt);
if (new == NULL) if (new_symbol == NULL)
return NULL; return NULL;
/* @@ The 10 is a guess at a plausible maximum number of aux entries /* @@ The 10 is a guess at a plausible maximum number of aux entries
(but shouldn't be a constant). */ (but shouldn't be a constant). */
amt = sizeof (combined_entry_type) * 10; amt = sizeof (combined_entry_type) * 10;
new->native = bfd_zalloc (abfd, amt); new_symbol->native = (combined_entry_type *) bfd_zalloc (abfd, amt);
if (!new->native) if (!new_symbol->native)
return NULL; return NULL;
new->symbol.section = bfd_abs_section_ptr; new_symbol->symbol.section = bfd_abs_section_ptr;
new->symbol.flags = BSF_DEBUGGING; new_symbol->symbol.flags = BSF_DEBUGGING;
new->lineno = NULL; new_symbol->lineno = NULL;
new->done_lineno = FALSE; new_symbol->done_lineno = FALSE;
new->symbol.the_bfd = abfd; new_symbol->symbol.the_bfd = abfd;
return & new->symbol; return & new_symbol->symbol;
} }
void void

View File

@ -81,19 +81,19 @@ ext_reg (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
static const char* static const char*
ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
{ {
ia64_insn new = 0; ia64_insn new_insn = 0;
int i; int i;
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
{ {
new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1)) new_insn |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
<< self->field[i].shift); << self->field[i].shift);
value >>= self->field[i].bits; value >>= self->field[i].bits;
} }
if (value) if (value)
return "integer operand out of range"; return "integer operand out of range";
*code |= new; *code |= new_insn;
return 0; return 0;
} }
@ -163,22 +163,22 @@ ins_imms_scaled (const struct ia64_operand *self, ia64_insn value,
ia64_insn *code, int scale) ia64_insn *code, int scale)
{ {
BFD_HOST_64_BIT svalue = value, sign_bit = 0; BFD_HOST_64_BIT svalue = value, sign_bit = 0;
ia64_insn new = 0; ia64_insn new_insn = 0;
int i; int i;
svalue >>= scale; svalue >>= scale;
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
{ {
new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1)) new_insn |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
<< self->field[i].shift); << self->field[i].shift);
sign_bit = (svalue >> (self->field[i].bits - 1)) & 1; sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
svalue >>= self->field[i].bits; svalue >>= self->field[i].bits;
} }
if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1)) if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1))
return "integer operand out of range"; return "integer operand out of range";
*code |= new; *code |= new_insn;
return 0; return 0;
} }

View File

@ -1,3 +1,8 @@
2009-08-29 Martin Thuresson <martin@mtme.org>
* chew.c (newentry, add_intrinsic): Rename variable new to
new_d.
2009-08-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 2009-08-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in: Regenerate. * Makefile.in: Regenerate.

View File

@ -1267,14 +1267,14 @@ dict_type *
newentry (word) newentry (word)
char *word; char *word;
{ {
dict_type *new = (dict_type *) malloc (sizeof (dict_type)); dict_type *new_d = (dict_type *) malloc (sizeof (dict_type));
new->word = word; new_d->word = word;
new->next = root; new_d->next = root;
root = new; root = new_d;
new->code = (stinst_type *) malloc (sizeof (stinst_type)); new_d->code = (stinst_type *) malloc (sizeof (stinst_type));
new->code_length = 1; new_d->code_length = 1;
new->code_end = 0; new_d->code_end = 0;
return new; return new_d;
} }
unsigned int unsigned int
@ -1299,19 +1299,19 @@ add_intrinsic (name, func)
char *name; char *name;
void (*func) (); void (*func) ();
{ {
dict_type *new = newentry (name); dict_type *new_d = newentry (name);
add_to_definition (new, func); add_to_definition (new_d, func);
add_to_definition (new, 0); add_to_definition (new_d, 0);
} }
void void
add_var (name) add_var (name)
char *name; char *name;
{ {
dict_type *new = newentry (name); dict_type *new_d = newentry (name);
add_to_definition (new, push_number); add_to_definition (new_d, push_number);
add_to_definition (new, (stinst_type) (&(new->var))); add_to_definition (new_d, (stinst_type) (&(new_d->var)));
add_to_definition (new, 0); add_to_definition (new_d, 0);
} }
void void

View File

@ -644,18 +644,18 @@ static asymbol *ecoff_scom_symbol_ptr;
asymbol * asymbol *
_bfd_ecoff_make_empty_symbol (bfd *abfd) _bfd_ecoff_make_empty_symbol (bfd *abfd)
{ {
ecoff_symbol_type *new; ecoff_symbol_type *new_symbol;
bfd_size_type amt = sizeof (ecoff_symbol_type); bfd_size_type amt = sizeof (ecoff_symbol_type);
new = bfd_zalloc (abfd, amt); new_symbol = (ecoff_symbol_type *) bfd_zalloc (abfd, amt);
if (new == NULL) if (new_symbol == NULL)
return NULL; return NULL;
new->symbol.section = NULL; new_symbol->symbol.section = NULL;
new->fdr = NULL; new_symbol->fdr = NULL;
new->local = FALSE; new_symbol->local = FALSE;
new->native = NULL; new_symbol->native = NULL;
new->symbol.the_bfd = abfd; new_symbol->symbol.the_bfd = abfd;
return &new->symbol; return &new_symbol->symbol;
} }
/* Set the BFD flags and section for an ECOFF symbol. */ /* Set the BFD flags and section for an ECOFF symbol. */

View File

@ -2235,7 +2235,7 @@ enum elf32_arm_stub_type {
typedef struct typedef struct
{ {
const insn_sequence* template; const insn_sequence* template_sequence;
int template_size; int template_size;
} stub_def; } stub_def;
@ -3443,7 +3443,7 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
bfd_vma sym_value; bfd_vma sym_value;
int template_size; int template_size;
int size; int size;
const insn_sequence *template; const insn_sequence *template_sequence;
int i; int i;
struct elf32_arm_link_hash_table * globals; struct elf32_arm_link_hash_table * globals;
int stub_reloc_idx[MAXRELOCS] = {-1, -1}; int stub_reloc_idx[MAXRELOCS] = {-1, -1};
@ -3480,18 +3480,18 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
+ stub_entry->target_section->output_offset + stub_entry->target_section->output_offset
+ stub_entry->target_section->output_section->vma); + stub_entry->target_section->output_section->vma);
template = stub_entry->stub_template; template_sequence = stub_entry->stub_template;
template_size = stub_entry->stub_template_size; template_size = stub_entry->stub_template_size;
size = 0; size = 0;
for (i = 0; i < template_size; i++) for (i = 0; i < template_size; i++)
{ {
switch (template[i].type) switch (template_sequence[i].type)
{ {
case THUMB16_TYPE: case THUMB16_TYPE:
{ {
bfd_vma data = template[i].data; bfd_vma data = (bfd_vma) template_sequence[i].data;
if (template[i].reloc_addend != 0) if (template_sequence[i].reloc_addend != 0)
{ {
/* We've borrowed the reloc_addend field to mean we should /* We've borrowed the reloc_addend field to mean we should
insert a condition code into this (Thumb-1 branch) insert a condition code into this (Thumb-1 branch)
@ -3505,11 +3505,12 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
break; break;
case THUMB32_TYPE: case THUMB32_TYPE:
put_thumb_insn (globals, stub_bfd, (template[i].data >> 16) & 0xffff, put_thumb_insn (globals, stub_bfd,
(template_sequence[i].data >> 16) & 0xffff,
loc + size); loc + size);
put_thumb_insn (globals, stub_bfd, template[i].data & 0xffff, put_thumb_insn (globals, stub_bfd, template_sequence[i].data & 0xffff,
loc + size + 2); loc + size + 2);
if (template[i].r_type != R_ARM_NONE) if (template_sequence[i].r_type != R_ARM_NONE)
{ {
stub_reloc_idx[nrelocs] = i; stub_reloc_idx[nrelocs] = i;
stub_reloc_offset[nrelocs++] = size; stub_reloc_offset[nrelocs++] = size;
@ -3518,10 +3519,11 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
break; break;
case ARM_TYPE: case ARM_TYPE:
put_arm_insn (globals, stub_bfd, template[i].data, loc + size); put_arm_insn (globals, stub_bfd, template_sequence[i].data,
loc + size);
/* Handle cases where the target is encoded within the /* Handle cases where the target is encoded within the
instruction. */ instruction. */
if (template[i].r_type == R_ARM_JUMP24) if (template_sequence[i].r_type == R_ARM_JUMP24)
{ {
stub_reloc_idx[nrelocs] = i; stub_reloc_idx[nrelocs] = i;
stub_reloc_offset[nrelocs++] = size; stub_reloc_offset[nrelocs++] = size;
@ -3530,7 +3532,7 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
break; break;
case DATA_TYPE: case DATA_TYPE:
bfd_put_32 (stub_bfd, template[i].data, loc + size); bfd_put_32 (stub_bfd, template_sequence[i].data, loc + size);
stub_reloc_idx[nrelocs] = i; stub_reloc_idx[nrelocs] = i;
stub_reloc_offset[nrelocs++] = size; stub_reloc_offset[nrelocs++] = size;
size += 4; size += 4;
@ -3557,22 +3559,23 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
BFD_ASSERT (nrelocs != 0 && nrelocs <= MAXRELOCS); BFD_ASSERT (nrelocs != 0 && nrelocs <= MAXRELOCS);
for (i = 0; i < nrelocs; i++) for (i = 0; i < nrelocs; i++)
if (template[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP24 if (template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP24
|| template[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP19 || template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP19
|| template[stub_reloc_idx[i]].r_type == R_ARM_THM_CALL || template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_CALL
|| template[stub_reloc_idx[i]].r_type == R_ARM_THM_XPC22) || template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_XPC22)
{ {
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_boolean unresolved_reloc; bfd_boolean unresolved_reloc;
char *error_message; char *error_message;
int sym_flags int sym_flags
= (template[stub_reloc_idx[i]].r_type != R_ARM_THM_XPC22) = (template_sequence[stub_reloc_idx[i]].r_type != R_ARM_THM_XPC22)
? STT_ARM_TFUNC : 0; ? STT_ARM_TFUNC : 0;
bfd_vma points_to = sym_value + stub_entry->target_addend; bfd_vma points_to = sym_value + stub_entry->target_addend;
rel.r_offset = stub_entry->stub_offset + stub_reloc_offset[i]; rel.r_offset = stub_entry->stub_offset + stub_reloc_offset[i];
rel.r_info = ELF32_R_INFO (0, template[stub_reloc_idx[i]].r_type); rel.r_info = ELF32_R_INFO (0,
rel.r_addend = template[stub_reloc_idx[i]].reloc_addend; template_sequence[stub_reloc_idx[i]].r_type);
rel.r_addend = template_sequence[stub_reloc_idx[i]].reloc_addend;
if (stub_entry->stub_type == arm_stub_a8_veneer_b_cond && i == 0) if (stub_entry->stub_type == arm_stub_a8_veneer_b_cond && i == 0)
/* The first relocation in the elf32_arm_stub_a8_veneer_b_cond[] /* The first relocation in the elf32_arm_stub_a8_veneer_b_cond[]
@ -3588,7 +3591,7 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
rather than only for certain relocations listed in the enclosing rather than only for certain relocations listed in the enclosing
conditional, for the sake of consistency. */ conditional, for the sake of consistency. */
elf32_arm_final_link_relocate (elf32_arm_howto_from_type elf32_arm_final_link_relocate (elf32_arm_howto_from_type
(template[stub_reloc_idx[i]].r_type), (template_sequence[stub_reloc_idx[i]].r_type),
stub_bfd, info->output_bfd, stub_sec, stub_sec->contents, &rel, stub_bfd, info->output_bfd, stub_sec, stub_sec->contents, &rel,
points_to, info, stub_entry->target_section, "", sym_flags, points_to, info, stub_entry->target_section, "", sym_flags,
(struct elf_link_hash_entry *) stub_entry->h, &unresolved_reloc, (struct elf_link_hash_entry *) stub_entry->h, &unresolved_reloc,
@ -3597,10 +3600,10 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
else else
{ {
_bfd_final_link_relocate (elf32_arm_howto_from_type _bfd_final_link_relocate (elf32_arm_howto_from_type
(template[stub_reloc_idx[i]].r_type), stub_bfd, stub_sec, (template_sequence[stub_reloc_idx[i]].r_type), stub_bfd, stub_sec,
stub_sec->contents, stub_entry->stub_offset + stub_reloc_offset[i], stub_sec->contents, stub_entry->stub_offset + stub_reloc_offset[i],
sym_value + stub_entry->target_addend, sym_value + stub_entry->target_addend,
template[stub_reloc_idx[i]].reloc_addend); template_sequence[stub_reloc_idx[i]].reloc_addend);
} }
return TRUE; return TRUE;
@ -3615,17 +3618,17 @@ find_stub_size_and_template (enum elf32_arm_stub_type stub_type,
const insn_sequence **stub_template, const insn_sequence **stub_template,
int *stub_template_size) int *stub_template_size)
{ {
const insn_sequence *template = NULL; const insn_sequence *template_sequence = NULL;
int template_size = 0, i; int template_size = 0, i;
unsigned int size; unsigned int size;
template = stub_definitions[stub_type].template; template_sequence = stub_definitions[stub_type].template_sequence;
template_size = stub_definitions[stub_type].template_size; template_size = stub_definitions[stub_type].template_size;
size = 0; size = 0;
for (i = 0; i < template_size; i++) for (i = 0; i < template_size; i++)
{ {
switch (template[i].type) switch (template_sequence[i].type)
{ {
case THUMB16_TYPE: case THUMB16_TYPE:
size += 2; size += 2;
@ -3644,7 +3647,7 @@ find_stub_size_and_template (enum elf32_arm_stub_type stub_type,
} }
if (stub_template) if (stub_template)
*stub_template = template; *stub_template = template_sequence;
if (stub_template_size) if (stub_template_size)
*stub_template_size = template_size; *stub_template_size = template_size;
@ -3661,7 +3664,7 @@ arm_size_one_stub (struct bfd_hash_entry *gen_entry,
{ {
struct elf32_arm_stub_hash_entry *stub_entry; struct elf32_arm_stub_hash_entry *stub_entry;
struct elf32_arm_link_hash_table *htab; struct elf32_arm_link_hash_table *htab;
const insn_sequence *template; const insn_sequence *template_sequence;
int template_size, size; int template_size, size;
/* Massage our args to the form they really have. */ /* Massage our args to the form they really have. */
@ -3671,11 +3674,11 @@ arm_size_one_stub (struct bfd_hash_entry *gen_entry,
BFD_ASSERT((stub_entry->stub_type > arm_stub_none) BFD_ASSERT((stub_entry->stub_type > arm_stub_none)
&& stub_entry->stub_type < ARRAY_SIZE(stub_definitions)); && stub_entry->stub_type < ARRAY_SIZE(stub_definitions));
size = find_stub_size_and_template (stub_entry->stub_type, &template, size = find_stub_size_and_template (stub_entry->stub_type, &template_sequence,
&template_size); &template_size);
stub_entry->stub_size = size; stub_entry->stub_size = size;
stub_entry->stub_template = template; stub_entry->stub_template = template_sequence;
stub_entry->stub_template_size = template_size; stub_entry->stub_template_size = template_size;
size = (size + 7) & ~7; size = (size + 7) & ~7;
@ -4679,7 +4682,7 @@ elf32_arm_size_stubs (bfd *output_bfd,
unsigned int section_id = a8_fixes[i].section->id; unsigned int section_id = a8_fixes[i].section->id;
asection *link_sec = htab->stub_group[section_id].link_sec; asection *link_sec = htab->stub_group[section_id].link_sec;
asection *stub_sec = htab->stub_group[section_id].stub_sec; asection *stub_sec = htab->stub_group[section_id].stub_sec;
const insn_sequence *template; const insn_sequence *template_sequence;
int template_size, size = 0; int template_size, size = 0;
stub_entry = arm_stub_hash_lookup (&htab->stub_hash_table, stub_name, stub_entry = arm_stub_hash_lookup (&htab->stub_hash_table, stub_name,
@ -4702,11 +4705,12 @@ elf32_arm_size_stubs (bfd *output_bfd,
stub_entry->orig_insn = a8_fixes[i].orig_insn; stub_entry->orig_insn = a8_fixes[i].orig_insn;
stub_entry->st_type = STT_ARM_TFUNC; stub_entry->st_type = STT_ARM_TFUNC;
size = find_stub_size_and_template (a8_fixes[i].stub_type, &template, size = find_stub_size_and_template (a8_fixes[i].stub_type,
&template_sequence,
&template_size); &template_size);
stub_entry->stub_size = size; stub_entry->stub_size = size;
stub_entry->stub_template = template; stub_entry->stub_template = template_sequence;
stub_entry->stub_template_size = template_size; stub_entry->stub_template_size = template_size;
} }
@ -12976,7 +12980,7 @@ arm_map_one_stub (struct bfd_hash_entry * gen_entry,
bfd_vma addr; bfd_vma addr;
char *stub_name; char *stub_name;
output_arch_syminfo *osi; output_arch_syminfo *osi;
const insn_sequence *template; const insn_sequence *template_sequence;
enum stub_insn_type prev_type; enum stub_insn_type prev_type;
int size; int size;
int i; int i;
@ -12999,8 +13003,8 @@ arm_map_one_stub (struct bfd_hash_entry * gen_entry,
addr = (bfd_vma) stub_entry->stub_offset; addr = (bfd_vma) stub_entry->stub_offset;
stub_name = stub_entry->output_name; stub_name = stub_entry->output_name;
template = stub_entry->stub_template; template_sequence = stub_entry->stub_template;
switch (template[0].type) switch (template_sequence[0].type)
{ {
case ARM_TYPE: case ARM_TYPE:
if (!elf32_arm_output_stub_sym (osi, stub_name, addr, stub_entry->stub_size)) if (!elf32_arm_output_stub_sym (osi, stub_name, addr, stub_entry->stub_size))
@ -13021,7 +13025,7 @@ arm_map_one_stub (struct bfd_hash_entry * gen_entry,
size = 0; size = 0;
for (i = 0; i < stub_entry->stub_template_size; i++) for (i = 0; i < stub_entry->stub_template_size; i++)
{ {
switch (template[i].type) switch (template_sequence[i].type)
{ {
case ARM_TYPE: case ARM_TYPE:
sym_type = ARM_MAP_ARM; sym_type = ARM_MAP_ARM;
@ -13041,14 +13045,14 @@ arm_map_one_stub (struct bfd_hash_entry * gen_entry,
return FALSE; return FALSE;
} }
if (template[i].type != prev_type) if (template_sequence[i].type != prev_type)
{ {
prev_type = template[i].type; prev_type = template_sequence[i].type;
if (!elf32_arm_output_map_sym (osi, sym_type, addr + size)) if (!elf32_arm_output_map_sym (osi, sym_type, addr + size))
return FALSE; return FALSE;
} }
switch (template[i].type) switch (template_sequence[i].type)
{ {
case ARM_TYPE: case ARM_TYPE:
case THUMB32_TYPE: case THUMB32_TYPE:

View File

@ -4045,6 +4045,23 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
{ {
struct elf_i386_link_hash_table *htab; struct elf_i386_link_hash_table *htab;
/* PR 10433: STT_GNU_IFUNC symbols must go through the PLT
only when they are referenced, not when they are defined. */
if (h->type == STT_GNU_IFUNC
&& h->def_regular
&& ! h->ref_regular
&& ! info->relocatable)
{
if (! ((h->dynindx != -1
|| h->forced_local)
&& ((info->shared
&& (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak))
|| ! h->forced_local)
&& elf_hash_table (info)->dynamic_sections_created))
return TRUE;
}
htab = elf_i386_hash_table (info); htab = elf_i386_hash_table (info);
if (h->plt.offset != (bfd_vma) -1) if (h->plt.offset != (bfd_vma) -1)

View File

@ -1531,7 +1531,7 @@ elf_m68k_get_got_entry (struct elf_m68k_got *got,
static enum elf_m68k_reloc_type static enum elf_m68k_reloc_type
elf_m68k_update_got_entry_type (struct elf_m68k_got *got, elf_m68k_update_got_entry_type (struct elf_m68k_got *got,
enum elf_m68k_reloc_type was, enum elf_m68k_reloc_type was,
enum elf_m68k_reloc_type new) enum elf_m68k_reloc_type new_reloc)
{ {
enum elf_m68k_got_offset_size was_size; enum elf_m68k_got_offset_size was_size;
enum elf_m68k_got_offset_size new_size; enum elf_m68k_got_offset_size new_size;
@ -1543,20 +1543,20 @@ elf_m68k_update_got_entry_type (struct elf_m68k_got *got,
/* Update all got->n_slots counters, including n_slots[R_32]. */ /* Update all got->n_slots counters, including n_slots[R_32]. */
was_size = R_LAST; was_size = R_LAST;
was = new; was = new_reloc;
} }
else else
{ {
/* !!! We, probably, should emit an error rather then fail on assert /* !!! We, probably, should emit an error rather then fail on assert
in such a case. */ in such a case. */
BFD_ASSERT (elf_m68k_reloc_got_type (was) BFD_ASSERT (elf_m68k_reloc_got_type (was)
== elf_m68k_reloc_got_type (new)); == elf_m68k_reloc_got_type (new_reloc));
was_size = elf_m68k_reloc_got_offset_size (was); was_size = elf_m68k_reloc_got_offset_size (was);
} }
new_size = elf_m68k_reloc_got_offset_size (new); new_size = elf_m68k_reloc_got_offset_size (new_reloc);
n_slots = elf_m68k_reloc_got_n_slots (new); n_slots = elf_m68k_reloc_got_n_slots (new_reloc);
while (was_size > new_size) while (was_size > new_size)
{ {
@ -1564,10 +1564,10 @@ elf_m68k_update_got_entry_type (struct elf_m68k_got *got,
got->n_slots[was_size] += n_slots; got->n_slots[was_size] += n_slots;
} }
if (new > was) if (new_reloc > was)
/* Relocations are ordered from bigger got offset size to lesser, /* Relocations are ordered from bigger got offset size to lesser,
so choose the relocation type with lesser offset size. */ so choose the relocation type with lesser offset size. */
was = new; was = new_reloc;
return was; return was;
} }

View File

@ -3716,6 +3716,23 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd,
{ {
struct elf64_x86_64_link_hash_table *htab; struct elf64_x86_64_link_hash_table *htab;
/* PR 10433: STT_GNU_IFUNC symbols must go through the PLT
only when they are referenced, not when they are defined. */
if (h->type == STT_GNU_IFUNC
&& h->def_regular
&& ! h->ref_regular
&& ! info->relocatable)
{
if (! ((h->dynindx != -1
|| h->forced_local)
&& ((info->shared
&& (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak))
|| ! h->forced_local)
&& elf_hash_table (info)->dynamic_sections_created))
return TRUE;
}
htab = elf64_x86_64_hash_table (info); htab = elf64_x86_64_hash_table (info);
if (h->plt.offset != (bfd_vma) -1) if (h->plt.offset != (bfd_vma) -1)

View File

@ -612,7 +612,7 @@ bfd_elfNN_ia64_after_parse (int itanium)
static bfd_boolean static bfd_boolean
elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off) elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
{ {
unsigned int template, mlx; unsigned int template_val, mlx;
bfd_vma t0, t1, s0, s1, s2, br_code; bfd_vma t0, t1, s0, s1, s2, br_code;
long br_slot; long br_slot;
bfd_byte *hit_addr; bfd_byte *hit_addr;
@ -626,7 +626,7 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
/* Check if we can turn br into brl. A label is always at the start /* Check if we can turn br into brl. A label is always at the start
of the bundle. Even if there are predicates on NOPs, we still of the bundle. Even if there are predicates on NOPs, we still
perform this optimization. */ perform this optimization. */
template = t0 & 0x1e; template_val = t0 & 0x1e;
s0 = (t0 >> 5) & 0x1ffffffffffLL; s0 = (t0 >> 5) & 0x1ffffffffffLL;
s1 = ((t0 >> 46) | (t1 << 18)) & 0x1ffffffffffLL; s1 = ((t0 >> 46) | (t1 << 18)) & 0x1ffffffffffLL;
s2 = (t1 >> 23) & 0x1ffffffffffLL; s2 = (t1 >> 23) & 0x1ffffffffffLL;
@ -642,9 +642,9 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
case 1: case 1:
/* Check if slot 2 is NOP. Possible templates are MBB and BBB. /* Check if slot 2 is NOP. Possible templates are MBB and BBB.
For BBB, slot 0 also has to be nop.b. */ For BBB, slot 0 also has to be nop.b. */
if (!((template == 0x12 /* MBB */ if (!((template_val == 0x12 /* MBB */
&& IS_NOP_B (s2)) && IS_NOP_B (s2))
|| (template == 0x16 /* BBB */ || (template_val == 0x16 /* BBB */
&& IS_NOP_B (s0) && IS_NOP_B (s0)
&& IS_NOP_B (s2)))) && IS_NOP_B (s2))))
return FALSE; return FALSE;
@ -653,16 +653,16 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
case 2: case 2:
/* Check if slot 1 is NOP. Possible templates are MIB, MBB, BBB, /* Check if slot 1 is NOP. Possible templates are MIB, MBB, BBB,
MMB and MFB. For BBB, slot 0 also has to be nop.b. */ MMB and MFB. For BBB, slot 0 also has to be nop.b. */
if (!((template == 0x10 /* MIB */ if (!((template_val == 0x10 /* MIB */
&& IS_NOP_I (s1)) && IS_NOP_I (s1))
|| (template == 0x12 /* MBB */ || (template_val == 0x12 /* MBB */
&& IS_NOP_B (s1)) && IS_NOP_B (s1))
|| (template == 0x16 /* BBB */ || (template_val == 0x16 /* BBB */
&& IS_NOP_B (s0) && IS_NOP_B (s0)
&& IS_NOP_B (s1)) && IS_NOP_B (s1))
|| (template == 0x18 /* MMB */ || (template_val == 0x18 /* MMB */
&& IS_NOP_M (s1)) && IS_NOP_M (s1))
|| (template == 0x1c /* MFB */ || (template_val == 0x1c /* MFB */
&& IS_NOP_F (s1)))) && IS_NOP_F (s1))))
return FALSE; return FALSE;
br_code = s2; br_code = s2;
@ -686,7 +686,7 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
else else
mlx = 0x4; mlx = 0x4;
if (template == 0x16) if (template_val == 0x16)
{ {
/* For BBB, we need to put nop.m in slot 0. We keep the original /* For BBB, we need to put nop.m in slot 0. We keep the original
predicate only if slot 0 isn't br. */ predicate only if slot 0 isn't br. */
@ -715,7 +715,7 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
static void static void
elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off) elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off)
{ {
int template; int template_val;
bfd_byte *hit_addr; bfd_byte *hit_addr;
bfd_vma t0, t1, i0, i1, i2; bfd_vma t0, t1, i0, i1, i2;
@ -734,10 +734,10 @@ elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off)
/* Turn a MLX bundle into a MBB bundle with the same stop-bit /* Turn a MLX bundle into a MBB bundle with the same stop-bit
variety. */ variety. */
if (t0 & 0x1) if (t0 & 0x1)
template = 0x13; template_val = 0x13;
else else
template = 0x12; template_val = 0x12;
t0 = (i1 << 46) | (i0 << 5) | template; t0 = (i1 << 46) | (i0 << 5) | template_val;
t1 = (i2 << 23) | (i1 >> 18); t1 = (i2 << 23) | (i1 >> 18);
bfd_putl64 (t0, hit_addr); bfd_putl64 (t0, hit_addr);

View File

@ -453,16 +453,17 @@ bfd_hash_lookup (struct bfd_hash_table *table,
if (copy) if (copy)
{ {
char *new; char *new_string;
new = objalloc_alloc ((struct objalloc *) table->memory, len + 1); new_string = (char *) objalloc_alloc ((struct objalloc *) table->memory,
if (!new) len + 1);
if (!new_string)
{ {
bfd_set_error (bfd_error_no_memory); bfd_set_error (bfd_error_no_memory);
return NULL; return NULL;
} }
memcpy (new, string, len + 1); memcpy (new_string, string, len + 1);
string = new; string = new_string;
} }
return bfd_hash_insert (table, string, hash); return bfd_hash_insert (table, string, hash);

View File

@ -3627,12 +3627,12 @@ static asymbol *
ieee_make_empty_symbol (bfd *abfd) ieee_make_empty_symbol (bfd *abfd)
{ {
bfd_size_type amt = sizeof (ieee_symbol_type); bfd_size_type amt = sizeof (ieee_symbol_type);
ieee_symbol_type *new = bfd_zalloc (abfd, amt); ieee_symbol_type *new_symbol = (ieee_symbol_type *) bfd_zalloc (abfd, amt);
if (!new) if (!new_symbol)
return NULL; return NULL;
new->symbol.the_bfd = abfd; new_symbol->symbol.the_bfd = abfd;
return &new->symbol; return &new_symbol->symbol;
} }
static bfd * static bfd *

View File

@ -2604,21 +2604,21 @@ struct bfd_link_order *
bfd_new_link_order (bfd *abfd, asection *section) bfd_new_link_order (bfd *abfd, asection *section)
{ {
bfd_size_type amt = sizeof (struct bfd_link_order); bfd_size_type amt = sizeof (struct bfd_link_order);
struct bfd_link_order *new; struct bfd_link_order *new_lo;
new = bfd_zalloc (abfd, amt); new_lo = (struct bfd_link_order *) bfd_zalloc (abfd, amt);
if (!new) if (!new_lo)
return NULL; return NULL;
new->type = bfd_undefined_link_order; new_lo->type = bfd_undefined_link_order;
if (section->map_tail.link_order != NULL) if (section->map_tail.link_order != NULL)
section->map_tail.link_order->next = new; section->map_tail.link_order->next = new_lo;
else else
section->map_head.link_order = new; section->map_head.link_order = new_lo;
section->map_tail.link_order = new; section->map_tail.link_order = new_lo;
return new; return new_lo;
} }
/* Default link order processing routine. Note that we can not handle /* Default link order processing routine. Note that we can not handle

View File

@ -1255,14 +1255,14 @@ bfd_mach_o_sizeof_headers (bfd *a ATTRIBUTE_UNUSED,
asymbol * asymbol *
bfd_mach_o_make_empty_symbol (bfd *abfd) bfd_mach_o_make_empty_symbol (bfd *abfd)
{ {
asymbol *new; asymbol *new_symbol;
new = bfd_zalloc (abfd, sizeof (bfd_mach_o_asymbol)); new_symbol = bfd_zalloc (abfd, sizeof (bfd_mach_o_asymbol));
if (new == NULL) if (new_symbol == NULL)
return new; return new_symbol;
new->the_bfd = abfd; new_symbol->the_bfd = abfd;
new->udata.i = 0; new_symbol->udata.i = 0;
return new; return new_symbol;
} }
static bfd_boolean static bfd_boolean

View File

@ -1084,12 +1084,12 @@ static asymbol *
oasys_make_empty_symbol (bfd *abfd) oasys_make_empty_symbol (bfd *abfd)
{ {
bfd_size_type amt = sizeof (oasys_symbol_type); bfd_size_type amt = sizeof (oasys_symbol_type);
oasys_symbol_type *new = bfd_zalloc (abfd, amt); oasys_symbol_type *new_symbol_type = bfd_zalloc (abfd, amt);
if (!new) if (!new_symbol_type)
return NULL; return NULL;
new->symbol.the_bfd = abfd; new_symbol_type->symbol.the_bfd = abfd;
return &new->symbol; return &new_symbol_type->symbol;
} }
/* User should have checked the file flags; perhaps we should return /* User should have checked the file flags; perhaps we should return

View File

@ -1433,13 +1433,13 @@ asymbol *
NAME (aout, make_empty_symbol) (bfd *abfd) NAME (aout, make_empty_symbol) (bfd *abfd)
{ {
bfd_size_type amt = sizeof (aout_symbol_type); bfd_size_type amt = sizeof (aout_symbol_type);
aout_symbol_type *new = bfd_zalloc (abfd, amt); aout_symbol_type *new_symbol_type = bfd_zalloc (abfd, amt);
if (!new) if (!new_symbol_type)
return NULL; return NULL;
new->symbol.the_bfd = abfd; new_symbol_type->symbol.the_bfd = abfd;
return &new->symbol; return &new_symbol_type->symbol;
} }
/* Translate a set of internal symbols into external symbols. */ /* Translate a set of internal symbols into external symbols. */

View File

@ -415,11 +415,11 @@ bfd_plugin_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED,
static asymbol * static asymbol *
bfd_plugin_make_empty_symbol (bfd *abfd) bfd_plugin_make_empty_symbol (bfd *abfd)
{ {
asymbol *new = bfd_zalloc (abfd, sizeof (asymbol)); asymbol *new_symbol = bfd_zalloc (abfd, sizeof (asymbol));
if (new == NULL) if (new_symbol == NULL)
return new; return new_symbol;
new->the_bfd = abfd; new_symbol->the_bfd = abfd;
return new; return new_symbol;
} }
static int static int

View File

@ -107,9 +107,9 @@ typedef union {
typedef union { typedef union {
#ifdef AIX_CORE_DUMPX_CORE #ifdef AIX_CORE_DUMPX_CORE
struct core_dumpx new; /* new AIX 4.3+ core dump */ struct core_dumpx new_dump; /* new AIX 4.3+ core dump */
#else #else
struct core_dump new; /* for simpler coding */ struct core_dump new_dump; /* for simpler coding */
#endif #endif
struct core_dump old; /* old AIX 4.2- core dump, still used on struct core_dump old; /* old AIX 4.2- core dump, still used on
4.3+ with appropriate SMIT config */ 4.3+ with appropriate SMIT config */
@ -120,9 +120,9 @@ typedef union {
#ifdef CORE_VERSION_1 #ifdef CORE_VERSION_1
typedef union { typedef union {
#ifdef AIX_CORE_DUMPX_CORE #ifdef AIX_CORE_DUMPX_CORE
struct vm_infox new; struct vm_infox new_dump;
#else #else
struct vm_info new; struct vm_info new_dump;
#endif #endif
struct vm_info old; struct vm_info old;
} VmInfo; } VmInfo;
@ -144,7 +144,7 @@ typedef union {
#ifdef AIX_5_CORE #ifdef AIX_5_CORE
# define CORE_DUMPXX_VERSION 267312562 # define CORE_DUMPXX_VERSION 267312562
# define CNEW_IS_CORE_DUMPXX(c) ((c).new.c_version == CORE_DUMPXX_VERSION) # define CNEW_IS_CORE_DUMPXX(c) ((c).new_dump.c_version == CORE_DUMPXX_VERSION)
#else #else
# define CNEW_IS_CORE_DUMPXX(c) 0 # define CNEW_IS_CORE_DUMPXX(c) 0
#endif #endif
@ -291,7 +291,7 @@ read_hdr (bfd *abfd, CoreHdr *core)
/* Read the trailing portion of the structure. */ /* Read the trailing portion of the structure. */
if (CORE_NEW (*core)) if (CORE_NEW (*core))
size = sizeof (core->new); size = sizeof (core->new_core);
else else
size = sizeof (core->old); size = sizeof (core->old);
size -= CORE_COMMONSZ; size -= CORE_COMMONSZ;
@ -352,13 +352,13 @@ rs6000coff_core_p (bfd *abfd)
/* Copy fields from new or old core structure. */ /* Copy fields from new or old core structure. */
if (CORE_NEW (core)) if (CORE_NEW (core))
{ {
c_flag = core.new.c_flag; c_flag = core.new_dump.c_flag;
c_stack = (file_ptr) core.new.c_stack; c_stack = (file_ptr) core.new_dump.c_stack;
c_size = core.new.c_size; c_size = core.new_dump.c_size;
c_stackend = CNEW_STACKORG (core.new) + c_size; c_stackend = CNEW_STACKORG (core.new_dump) + c_size;
c_lsize = CNEW_LSIZE (core.new); c_lsize = CNEW_LSIZE (core.new_dump);
c_loader = CNEW_LOADER (core.new); c_loader = CNEW_LOADER (core.new_dump);
proc64 = CNEW_PROC64 (core.new); proc64 = CNEW_PROC64 (core.new_dump);
} }
else else
{ {
@ -373,13 +373,13 @@ rs6000coff_core_p (bfd *abfd)
if (proc64) if (proc64)
{ {
c_regsize = sizeof (CNEW_CONTEXT64 (core.new)); c_regsize = sizeof (CNEW_CONTEXT64 (core.new_dump));
c_regptr = &CNEW_CONTEXT64 (core.new); c_regptr = &CNEW_CONTEXT64 (core.new_dump);
} }
else if (CORE_NEW (core)) else if (CORE_NEW (core))
{ {
c_regsize = sizeof (CNEW_MSTSAVE (core.new)); c_regsize = sizeof (CNEW_MSTSAVE (core.new_dump));
c_regptr = &CNEW_MSTSAVE (core.new); c_regptr = &CNEW_MSTSAVE (core.new_dump);
} }
else else
{ {
@ -449,7 +449,7 @@ rs6000coff_core_p (bfd *abfd)
bfd_get_filename (abfd)); bfd_get_filename (abfd));
/* Allocate core file header. */ /* Allocate core file header. */
size = CORE_NEW (core) ? sizeof (core.new) : sizeof (core.old); size = CORE_NEW (core) ? sizeof (core.new_dump) : sizeof (core.old);
tmpptr = (char *) bfd_zalloc (abfd, (bfd_size_type) size); tmpptr = (char *) bfd_zalloc (abfd, (bfd_size_type) size);
if (!tmpptr) if (!tmpptr)
return NULL; return NULL;
@ -464,7 +464,7 @@ rs6000coff_core_p (bfd *abfd)
enum bfd_architecture arch; enum bfd_architecture arch;
unsigned long mach; unsigned long mach;
switch (CNEW_IMPL (core.new)) switch (CNEW_IMPL (core.new_dump))
{ {
case POWER_RS1: case POWER_RS1:
case POWER_RSC: case POWER_RSC:
@ -537,10 +537,10 @@ rs6000coff_core_p (bfd *abfd)
if (CORE_NEW (core)) if (CORE_NEW (core))
{ {
c_datasize = CNEW_DATASIZE (core.new); c_datasize = CNEW_DATASIZE (core.new_dump);
c_data = (file_ptr) core.new.c_data; c_data = (file_ptr) core.new_dump.c_data;
c_vmregions = core.new.c_vmregions; c_vmregions = core.new_dump.c_vmregions;
c_vmm = (file_ptr) core.new.c_vmm; c_vmm = (file_ptr) core.new_dump.c_vmm;
} }
else else
{ {
@ -615,15 +615,15 @@ rs6000coff_core_p (bfd *abfd)
file_ptr vminfo_offset; file_ptr vminfo_offset;
bfd_vma vminfo_addr; bfd_vma vminfo_addr;
size = CORE_NEW (core) ? sizeof (vminfo.new) : sizeof (vminfo.old); size = CORE_NEW (core) ? sizeof (vminfo.new_dump) : sizeof (vminfo.old);
if (bfd_bread (&vminfo, size, abfd) != size) if (bfd_bread (&vminfo, size, abfd) != size)
goto fail; goto fail;
if (CORE_NEW (core)) if (CORE_NEW (core))
{ {
vminfo_addr = (bfd_vma) vminfo.new.vminfo_addr; vminfo_addr = (bfd_vma) vminfo.new_dump.vminfo_addr;
vminfo_size = vminfo.new.vminfo_size; vminfo_size = vminfo.new_dump.vminfo_size;
vminfo_offset = vminfo.new.vminfo_offset; vminfo_offset = vminfo.new_dump.vminfo_offset;
} }
else else
{ {
@ -669,11 +669,11 @@ rs6000coff_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
return FALSE; return FALSE;
if (CORE_NEW (core)) if (CORE_NEW (core))
c_loader = CNEW_LOADER (core.new); c_loader = CNEW_LOADER (core.new_dump);
else else
c_loader = (file_ptr) (ptr_to_uint) COLD_LOADER (core.old); c_loader = (file_ptr) (ptr_to_uint) COLD_LOADER (core.old);
if (CORE_NEW (core) && CNEW_PROC64 (core.new)) if (CORE_NEW (core) && CNEW_PROC64 (core.new_dump))
size = (int) ((LdInfo *) 0)->l64.ldinfo_filename; size = (int) ((LdInfo *) 0)->l64.ldinfo_filename;
else else
size = (int) ((LdInfo *) 0)->l32.ldinfo_filename; size = (int) ((LdInfo *) 0)->l32.ldinfo_filename;
@ -735,7 +735,7 @@ rs6000coff_core_file_failing_command (bfd *abfd)
{ {
CoreHdr *core = core_hdr (abfd); CoreHdr *core = core_hdr (abfd);
char *com = CORE_NEW (*core) ? char *com = CORE_NEW (*core) ?
CNEW_COMM (core->new) : COLD_COMM (core->old); CNEW_COMM (core->new_dump) : COLD_COMM (core->old);
if (*com) if (*com)
return com; return com;
@ -747,7 +747,7 @@ int
rs6000coff_core_file_failing_signal (bfd *abfd) rs6000coff_core_file_failing_signal (bfd *abfd)
{ {
CoreHdr *core = core_hdr (abfd); CoreHdr *core = core_hdr (abfd);
return CORE_NEW (*core) ? core->new.c_signo : core->old.c_signo; return CORE_NEW (*core) ? core->new_dump.c_signo : core->old.c_signo;
} }
#endif /* AIX_CORE */ #endif /* AIX_CORE */

View File

@ -4472,13 +4472,13 @@ static asymbol *
som_make_empty_symbol (bfd *abfd) som_make_empty_symbol (bfd *abfd)
{ {
bfd_size_type amt = sizeof (som_symbol_type); bfd_size_type amt = sizeof (som_symbol_type);
som_symbol_type *new = bfd_zalloc (abfd, amt); som_symbol_type *new_symbol_type = bfd_zalloc (abfd, amt);
if (new == NULL) if (new_symbol_type == NULL)
return NULL; return NULL;
new->symbol.the_bfd = abfd; new_symbol_type->symbol.the_bfd = abfd;
return &new->symbol; return &new_symbol_type->symbol;
} }
/* Print symbol information. */ /* Print symbol information. */

View File

@ -539,10 +539,10 @@ asymbol *
_bfd_generic_make_empty_symbol (bfd *abfd) _bfd_generic_make_empty_symbol (bfd *abfd)
{ {
bfd_size_type amt = sizeof (asymbol); bfd_size_type amt = sizeof (asymbol);
asymbol *new = bfd_zalloc (abfd, amt); asymbol *new_symbol = (asymbol *) bfd_zalloc (abfd, amt);
if (new) if (new_symbol)
new->the_bfd = abfd; new_symbol->the_bfd = abfd;
return new; return new_symbol;
} }
/* /*

View File

@ -415,31 +415,33 @@ first_phase (bfd *abfd, int type, char *src)
/* Symbols, add to section. */ /* Symbols, add to section. */
{ {
bfd_size_type amt = sizeof (tekhex_symbol_type); bfd_size_type amt = sizeof (tekhex_symbol_type);
tekhex_symbol_type *new = bfd_alloc (abfd, amt); tekhex_symbol_type *new_symbol = (tekhex_symbol_type *)
bfd_alloc (abfd, amt);
char stype = (*src); char stype = (*src);
if (!new) if (!new_symbol)
return FALSE; return FALSE;
new->symbol.the_bfd = abfd; new_symbol->symbol.the_bfd = abfd;
src++; src++;
abfd->symcount++; abfd->symcount++;
abfd->flags |= HAS_SYMS; abfd->flags |= HAS_SYMS;
new->prev = abfd->tdata.tekhex_data->symbols; new_symbol->prev = abfd->tdata.tekhex_data->symbols;
abfd->tdata.tekhex_data->symbols = new; abfd->tdata.tekhex_data->symbols = new_symbol;
if (!getsym (sym, &src, &len)) if (!getsym (sym, &src, &len))
return FALSE; return FALSE;
new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1); new_symbol->symbol.name = (const char *)
if (!new->symbol.name) bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!new_symbol->symbol.name)
return FALSE; return FALSE;
memcpy ((char *) (new->symbol.name), sym, len + 1); memcpy ((char *) (new_symbol->symbol.name), sym, len + 1);
new->symbol.section = section; new_symbol->symbol.section = section;
if (stype <= '4') if (stype <= '4')
new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT); new_symbol->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
else else
new->symbol.flags = BSF_LOCAL; new_symbol->symbol.flags = BSF_LOCAL;
if (!getvalue (&src, &val)) if (!getvalue (&src, &val))
return FALSE; return FALSE;
new->symbol.value = val - section->vma; new_symbol->symbol.value = val - section->vma;
break; break;
} }
default: default:
@ -880,13 +882,14 @@ static asymbol *
tekhex_make_empty_symbol (bfd *abfd) tekhex_make_empty_symbol (bfd *abfd)
{ {
bfd_size_type amt = sizeof (struct tekhex_symbol_struct); bfd_size_type amt = sizeof (struct tekhex_symbol_struct);
tekhex_symbol_type *new = bfd_zalloc (abfd, amt); tekhex_symbol_type *new_symbol = (tekhex_symbol_type *) bfd_zalloc (abfd,
amt);
if (!new) if (!new_symbol)
return NULL; return NULL;
new->symbol.the_bfd = abfd; new_symbol->symbol.the_bfd = abfd;
new->prev = NULL; new_symbol->prev = NULL;
return &(new->symbol); return &(new_symbol->symbol);
} }
static void static void

View File

@ -1,3 +1,7 @@
2009-08-29 Martin Thuresson <martin@mtme.org>
* nlmconv.c (main): Rename variable new to new_name.
2009-08-28 H.J. Lu <hongjiu.lu@intel.com> 2009-08-28 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am (sysinfo$(EXEEXT_FOR_BUILD)): Replace * Makefile.am (sysinfo$(EXEEXT_FOR_BUILD)): Replace

View File

@ -476,23 +476,23 @@ main (int argc, char **argv)
++sym->name; ++sym->name;
else else
{ {
char *new; char *new_name;
new = xmalloc (strlen (bfd_asymbol_name (sym)) + 1); new_name = xmalloc (strlen (bfd_asymbol_name (sym)) + 1);
new[0] = outlead; new_name[0] = outlead;
strcpy (new + 1, bfd_asymbol_name (sym) + 1); strcpy (new_name + 1, bfd_asymbol_name (sym) + 1);
sym->name = new; sym->name = new_name;
} }
} }
} }
else else
{ {
char *new; char *new_name;
new = xmalloc (strlen (bfd_asymbol_name (sym)) + 2); new_name = xmalloc (strlen (bfd_asymbol_name (sym)) + 2);
new[0] = outlead; new_name[0] = outlead;
strcpy (new + 1, bfd_asymbol_name (sym)); strcpy (new_name + 1, bfd_asymbol_name (sym));
sym->name = new; sym->name = new_name;
} }
} }

View File

@ -1,3 +1,63 @@
2009-08-29 Martin Thuresson <martin@mtme.org>
* config/tc-arm.c (struct asm_cond, struct asm_psr, struct
asm_barrier_opt): Change member template to
template_name. (md_begin): Update code to reflect new member
names.
* config/tc-i386.c (struct templates, struct _i386_insn)
(match_template, cpu_flags_match, match_reg_size, match_mem_size)
(operand_size_match, md_begin, i386_print_statistics, pi)
(build_vex_prefix, md_assemble, parse_insn, optimize_imm)
(optimize_disp): Updated code to use new names. (parse_insn):
Added casts.
* config/tc-ia64.c (dot_template, emit_one_bundle): Updated
code to use new names.
* config/tc-score.c (struct s3_asm_opcode): Renamed member
template to template_name. (s3_parse_16_32_inst, s3_parse_48_inst,
s3_do_macro_ldst_label, s3_build_score_ops_hsh): Update code to
use new names.
* config/tc-score7.c (struct s7_asm_opcode): Renamed member
template to template_name. (s7_parse_16_32_inst,
s7_do_macro_ldst_label, s7_build_score_ops_hsh): Update code to
use new names.
* config/tc-tic30.c (md_begin, struct tic30_insn)
(md_assemble): Update code to use new names.
* config/tc-tic54x.c (struct _tic54x_insn, md_begin)
(optimize_insn, tic54x_parse_insn, next_line_shows_parallel):
Update code to use new names.
* config/tc-arm.c (insert_reg_alias): Rename variable new to
new_reg.
* config/tc-dlx.c (parse_operand): Rename variable new to
new_pos.
* config/tc-ia64.c (ia64_gen_real_reloc_type): Rename variable
new to newr.
* config/tc-mcore.c (parse_exp, parse_imm): Rename variable
new to new_pointer.
* config/tc-microblaze.c (parse_exp, parse_imm, check_got):
Change name from new to new_pointer.
* config/tc-or32.c (parse_operand): Rename variable new to
new_pointer.
* config/tc-pdp11.c (md_assemble): Rename variable new to
new_pointer.
* config/tc-pj.c (alias): Change argument new to new_name.
* config/tc-score.c (s3_build_score_ops_hsh): Rename variable
new to new_opcode. (s3_build_dependency_insn_hsh) Rename variable
new to new_i2n. (s3_convert): Rename variables old and new to
r_old and r_new.
* config/tc-score7.c (s7_build_score_ops_hsh): Rename variable
new to new_opcode. (s7_build_dependency_insn_hsh): Rename variable
new to new_i2d. (s7_b32_relax_to_b16, s7_convert_frag): Rename
variables old and new to r_old and r_new.
* config/tc-sh.c (parse_exp): Rename variable new to
new_pointer.
* config/tc-sh64.c (shmedia_parse_exp): Rename variable new to
new_pointer.
* config/tc-tic4x.c (tic4x_operand_parse): Rename variable new
to new_pointer.
* config/tc-z8k.c (parse_exp): Rename variable new to
new_pointer.
* listing.c (listing_newline): Rename variable new to new_i.
2009-08-29 Matt Fleming <matt@console-pimps.org> 2009-08-29 Matt Fleming <matt@console-pimps.org>
* config/tc-sh.c (md_apply_fix): Extend sign of the offset value * config/tc-sh.c (md_apply_fix): Extend sign of the offset value

View File

@ -1691,15 +1691,17 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
} }
else if (strcmp (typename, "gnu_unique_object") == 0) else if (strcmp (typename, "gnu_unique_object") == 0)
{ {
const struct elf_backend_data *bed; struct elf_backend_data *bed;
bed = get_elf_backend_data (stdoutput); bed = (struct elf_backend_data *) get_elf_backend_data (stdoutput);
if (!(bed->elf_osabi == ELFOSABI_LINUX if (!(bed->elf_osabi == ELFOSABI_LINUX
/* GNU/Linux is still using the default value 0. */ /* GNU/Linux is still using the default value 0. */
|| bed->elf_osabi == ELFOSABI_NONE)) || bed->elf_osabi == ELFOSABI_NONE))
as_bad (_("symbol type \"%s\" is supported only by GNU targets"), as_bad (_("symbol type \"%s\" is supported only by GNU targets"),
typename); typename);
type = BSF_OBJECT | BSF_GNU_UNIQUE; type = BSF_OBJECT | BSF_GNU_UNIQUE;
/* PR 10549: Always set OSABI field to LINUX for objects containing unique symbols. */
bed->elf_osabi = ELFOSABI_LINUX;
} }
#ifdef md_elf_symbol_type #ifdef md_elf_symbol_type
else if ((type = md_elf_symbol_type (typename, sym, elfsym)) != -1) else if ((type = md_elf_symbol_type (typename, sym, elfsym)) != -1)

View File

@ -415,7 +415,7 @@ LITTLENUM_TYPE fp_values[NUM_FLOAT_VALS][MAX_LITTLENUMS];
struct asm_cond struct asm_cond
{ {
const char * template; const char * template_name;
unsigned long value; unsigned long value;
}; };
@ -423,13 +423,13 @@ struct asm_cond
struct asm_psr struct asm_psr
{ {
const char * template; const char * template_name;
unsigned long field; unsigned long field;
}; };
struct asm_barrier_opt struct asm_barrier_opt
{ {
const char * template; const char * template_name;
unsigned long value; unsigned long value;
}; };
@ -548,7 +548,7 @@ const char * const reg_expected_msgs[] =
struct asm_opcode struct asm_opcode
{ {
/* Basic string to match. */ /* Basic string to match. */
const char * template; const char * template_name;
/* Parameters to instruction. */ /* Parameters to instruction. */
unsigned char operands[8]; unsigned char operands[8];
@ -2048,35 +2048,35 @@ parse_reloc (char **str)
static struct reg_entry * static struct reg_entry *
insert_reg_alias (char *str, int number, int type) insert_reg_alias (char *str, int number, int type)
{ {
struct reg_entry *new; struct reg_entry *new_reg;
const char *name; const char *name;
if ((new = hash_find (arm_reg_hsh, str)) != 0) if ((new_reg = (struct reg_entry *) hash_find (arm_reg_hsh, str)) != 0)
{ {
if (new->builtin) if (new_reg->builtin)
as_warn (_("ignoring attempt to redefine built-in register '%s'"), str); as_warn (_("ignoring attempt to redefine built-in register '%s'"), str);
/* Only warn about a redefinition if it's not defined as the /* Only warn about a redefinition if it's not defined as the
same register. */ same register. */
else if (new->number != number || new->type != type) else if (new_reg->number != number || new_reg->type != type)
as_warn (_("ignoring redefinition of register alias '%s'"), str); as_warn (_("ignoring redefinition of register alias '%s'"), str);
return NULL; return NULL;
} }
name = xstrdup (str); name = xstrdup (str);
new = xmalloc (sizeof (struct reg_entry)); new_reg = (struct reg_entry *) xmalloc (sizeof (struct reg_entry));
new->name = name; new_reg->name = name;
new->number = number; new_reg->number = number;
new->type = type; new_reg->type = type;
new->builtin = FALSE; new_reg->builtin = FALSE;
new->neon = NULL; new_reg->neon = NULL;
if (hash_insert (arm_reg_hsh, name, (void *) new)) if (hash_insert (arm_reg_hsh, name, (void *) new_reg))
abort (); abort ();
return new; return new_reg;
} }
static void static void
@ -21296,21 +21296,22 @@ md_begin (void)
as_fatal (_("virtual memory exhausted")); as_fatal (_("virtual memory exhausted"));
for (i = 0; i < sizeof (insns) / sizeof (struct asm_opcode); i++) for (i = 0; i < sizeof (insns) / sizeof (struct asm_opcode); i++)
hash_insert (arm_ops_hsh, insns[i].template, (void *) (insns + i)); hash_insert (arm_ops_hsh, insns[i].template_name, (void *) (insns + i));
for (i = 0; i < sizeof (conds) / sizeof (struct asm_cond); i++) for (i = 0; i < sizeof (conds) / sizeof (struct asm_cond); i++)
hash_insert (arm_cond_hsh, conds[i].template, (void *) (conds + i)); hash_insert (arm_cond_hsh, conds[i].template_name, (void *) (conds + i));
for (i = 0; i < sizeof (shift_names) / sizeof (struct asm_shift_name); i++) for (i = 0; i < sizeof (shift_names) / sizeof (struct asm_shift_name); i++)
hash_insert (arm_shift_hsh, shift_names[i].name, (void *) (shift_names + i)); hash_insert (arm_shift_hsh, shift_names[i].name, (void *) (shift_names + i));
for (i = 0; i < sizeof (psrs) / sizeof (struct asm_psr); i++) for (i = 0; i < sizeof (psrs) / sizeof (struct asm_psr); i++)
hash_insert (arm_psr_hsh, psrs[i].template, (void *) (psrs + i)); hash_insert (arm_psr_hsh, psrs[i].template_name, (void *) (psrs + i));
for (i = 0; i < sizeof (v7m_psrs) / sizeof (struct asm_psr); i++) for (i = 0; i < sizeof (v7m_psrs) / sizeof (struct asm_psr); i++)
hash_insert (arm_v7m_psr_hsh, v7m_psrs[i].template, (void *) (v7m_psrs + i)); hash_insert (arm_v7m_psr_hsh, v7m_psrs[i].template_name,
(void *) (v7m_psrs + i));
for (i = 0; i < sizeof (reg_names) / sizeof (struct reg_entry); i++) for (i = 0; i < sizeof (reg_names) / sizeof (struct reg_entry); i++)
hash_insert (arm_reg_hsh, reg_names[i].name, (void *) (reg_names + i)); hash_insert (arm_reg_hsh, reg_names[i].name, (void *) (reg_names + i));
for (i = 0; for (i = 0;
i < sizeof (barrier_opt_names) / sizeof (struct asm_barrier_opt); i < sizeof (barrier_opt_names) / sizeof (struct asm_barrier_opt);
i++) i++)
hash_insert (arm_barrier_opt_hsh, barrier_opt_names[i].template, hash_insert (arm_barrier_opt_hsh, barrier_opt_names[i].template_name,
(void *) (barrier_opt_names + i)); (void *) (barrier_opt_names + i));
#ifdef OBJ_ELF #ifdef OBJ_ELF
for (i = 0; i < sizeof (reloc_names) / sizeof (struct reloc_entry); i++) for (i = 0; i < sizeof (reloc_names) / sizeof (struct reloc_entry); i++)

View File

@ -594,7 +594,7 @@ static char *
parse_operand (char *s, expressionS *operandp) parse_operand (char *s, expressionS *operandp)
{ {
char *save = input_line_pointer; char *save = input_line_pointer;
char *new; char *new_pos;
the_insn.HI = the_insn.LO = 0; the_insn.HI = the_insn.LO = 0;
@ -641,9 +641,9 @@ parse_operand (char *s, expressionS *operandp)
(void) expression (operandp); (void) expression (operandp);
} }
new = input_line_pointer; new_pos = input_line_pointer;
input_line_pointer = save; input_line_pointer = save;
return new; return new_pos;
} }
/* Instruction parsing. Takes a string containing the opcode. /* Instruction parsing. Takes a string containing the opcode.

View File

@ -97,8 +97,8 @@
*/ */
typedef struct typedef struct
{ {
const template *start; const insn_template *start;
const template *end; const insn_template *end;
} }
templates; templates;
@ -159,7 +159,7 @@ static void swap_operands (void);
static void swap_2_operands (int, int); static void swap_2_operands (int, int);
static void optimize_imm (void); static void optimize_imm (void);
static void optimize_disp (void); static void optimize_disp (void);
static const template *match_template (void); static const insn_template *match_template (void);
static int check_string (void); static int check_string (void);
static int process_suffix (void); static int process_suffix (void);
static int check_byte_reg (void); static int check_byte_reg (void);
@ -204,7 +204,7 @@ union i386_op
struct _i386_insn struct _i386_insn
{ {
/* TM holds the template for the insn were currently assembling. */ /* TM holds the template for the insn were currently assembling. */
template tm; insn_template tm;
/* SUFFIX holds the instruction size suffix for byte, word, dword /* SUFFIX holds the instruction size suffix for byte, word, dword
or qword, if given. */ or qword, if given. */
@ -1287,7 +1287,7 @@ cpu_flags_and_not (i386_cpu_flags x, i386_cpu_flags y)
/* Return CPU flags match bits. */ /* Return CPU flags match bits. */
static int static int
cpu_flags_match (const template *t) cpu_flags_match (const insn_template *t)
{ {
i386_cpu_flags x = t->cpu_flags; i386_cpu_flags x = t->cpu_flags;
int match = cpu_flags_check_cpu64 (x) ? CPU_FLAGS_64BIT_MATCH : 0; int match = cpu_flags_check_cpu64 (x) ? CPU_FLAGS_64BIT_MATCH : 0;
@ -1471,7 +1471,7 @@ operand_type_check (i386_operand_type t, enum operand_type c)
operand J for instruction template T. */ operand J for instruction template T. */
static INLINE int static INLINE int
match_reg_size (const template *t, unsigned int j) match_reg_size (const insn_template *t, unsigned int j)
{ {
return !((i.types[j].bitfield.byte return !((i.types[j].bitfield.byte
&& !t->operand_types[j].bitfield.byte) && !t->operand_types[j].bitfield.byte)
@ -1487,7 +1487,7 @@ match_reg_size (const template *t, unsigned int j)
instruction template T. */ instruction template T. */
static INLINE int static INLINE int
match_mem_size (const template *t, unsigned int j) match_mem_size (const insn_template *t, unsigned int j)
{ {
return (match_reg_size (t, j) return (match_reg_size (t, j)
&& !((i.types[j].bitfield.unspecified && !((i.types[j].bitfield.unspecified
@ -1506,7 +1506,7 @@ match_mem_size (const template *t, unsigned int j)
instruction template T. */ instruction template T. */
static INLINE int static INLINE int
operand_size_match (const template *t) operand_size_match (const insn_template *t)
{ {
unsigned int j; unsigned int j;
int match = 1; int match = 1;
@ -2127,7 +2127,7 @@ md_begin ()
op_hash = hash_new (); op_hash = hash_new ();
{ {
const template *optab; const insn_template *optab;
templates *core_optab; templates *core_optab;
/* Setup for loop. */ /* Setup for loop. */
@ -2262,7 +2262,7 @@ i386_print_statistics (FILE *file)
#ifdef DEBUG386 #ifdef DEBUG386
/* Debugging routines for md_assemble. */ /* Debugging routines for md_assemble. */
static void pte (template *); static void pte (insn_template *);
static void pt (i386_operand_type); static void pt (i386_operand_type);
static void pe (expressionS *); static void pe (expressionS *);
static void ps (symbolS *); static void ps (symbolS *);
@ -2313,7 +2313,7 @@ pi (char *line, i386_insn *x)
} }
static void static void
pte (template *t) pte (insn_template *t)
{ {
unsigned int i; unsigned int i;
fprintf (stdout, " %d operands ", t->operands); fprintf (stdout, " %d operands ", t->operands);
@ -2628,7 +2628,7 @@ intel_float_operand (const char *mnemonic)
/* Build the VEX prefix. */ /* Build the VEX prefix. */
static void static void
build_vex_prefix (const template *t) build_vex_prefix (const insn_template *t)
{ {
unsigned int register_specifier; unsigned int register_specifier;
unsigned int implied_prefix; unsigned int implied_prefix;
@ -2804,7 +2804,7 @@ md_assemble (char *line)
{ {
unsigned int j; unsigned int j;
char mnemonic[MAX_MNEM_SIZE]; char mnemonic[MAX_MNEM_SIZE];
const template *t; const insn_template *t;
/* Initialize globals. */ /* Initialize globals. */
memset (&i, '\0', sizeof (i)); memset (&i, '\0', sizeof (i));
@ -3025,7 +3025,7 @@ parse_insn (char *line, char *mnemonic)
char *token_start = l; char *token_start = l;
char *mnem_p; char *mnem_p;
int supported; int supported;
const template *t; const insn_template *t;
char *dot_p = NULL; char *dot_p = NULL;
/* Non-zero if we found a prefix only acceptable with string insns. */ /* Non-zero if we found a prefix only acceptable with string insns. */
@ -3066,7 +3066,7 @@ parse_insn (char *line, char *mnemonic)
} }
/* Look up instruction (or prefix) via hash table. */ /* Look up instruction (or prefix) via hash table. */
current_templates = hash_find (op_hash, mnemonic); current_templates = (const templates *) hash_find (op_hash, mnemonic);
if (*l != END_OF_INSN if (*l != END_OF_INSN
&& (!is_space_char (*l) || l[1] != END_OF_INSN) && (!is_space_char (*l) || l[1] != END_OF_INSN)
@ -3118,7 +3118,7 @@ parse_insn (char *line, char *mnemonic)
goto check_suffix; goto check_suffix;
mnem_p = dot_p; mnem_p = dot_p;
*dot_p = '\0'; *dot_p = '\0';
current_templates = hash_find (op_hash, mnemonic); current_templates = (const templates *) hash_find (op_hash, mnemonic);
} }
if (!current_templates) if (!current_templates)
@ -3135,7 +3135,8 @@ check_suffix:
case QWORD_MNEM_SUFFIX: case QWORD_MNEM_SUFFIX:
i.suffix = mnem_p[-1]; i.suffix = mnem_p[-1];
mnem_p[-1] = '\0'; mnem_p[-1] = '\0';
current_templates = hash_find (op_hash, mnemonic); current_templates = (const templates *) hash_find (op_hash,
mnemonic);
break; break;
case SHORT_MNEM_SUFFIX: case SHORT_MNEM_SUFFIX:
case LONG_MNEM_SUFFIX: case LONG_MNEM_SUFFIX:
@ -3143,7 +3144,8 @@ check_suffix:
{ {
i.suffix = mnem_p[-1]; i.suffix = mnem_p[-1];
mnem_p[-1] = '\0'; mnem_p[-1] = '\0';
current_templates = hash_find (op_hash, mnemonic); current_templates = (const templates *) hash_find (op_hash,
mnemonic);
} }
break; break;
@ -3156,7 +3158,8 @@ check_suffix:
else else
i.suffix = LONG_MNEM_SUFFIX; i.suffix = LONG_MNEM_SUFFIX;
mnem_p[-1] = '\0'; mnem_p[-1] = '\0';
current_templates = hash_find (op_hash, mnemonic); current_templates = (const templates *) hash_find (op_hash,
mnemonic);
} }
break; break;
} }
@ -3529,7 +3532,7 @@ optimize_imm (void)
than those matching the insn suffix. */ than those matching the insn suffix. */
{ {
i386_operand_type mask, allowed; i386_operand_type mask, allowed;
const template *t; const insn_template *t;
operand_type_set (&mask, 0); operand_type_set (&mask, 0);
operand_type_set (&allowed, 0); operand_type_set (&allowed, 0);
@ -3641,11 +3644,11 @@ optimize_disp (void)
} }
} }
static const template * static const insn_template *
match_template (void) match_template (void)
{ {
/* Points to template once we've found it. */ /* Points to template once we've found it. */
const template *t; const insn_template *t;
i386_operand_type overlap0, overlap1, overlap2, overlap3; i386_operand_type overlap0, overlap1, overlap2, overlap3;
i386_operand_type overlap4; i386_operand_type overlap4;
unsigned int found_reverse_match; unsigned int found_reverse_match;

View File

@ -4421,9 +4421,9 @@ dot_endp (int dummy ATTRIBUTE_UNUSED)
} }
static void static void
dot_template (int template) dot_template (int template_val)
{ {
CURR_SLOT.user_template = template; CURR_SLOT.user_template = template_val;
} }
static void static void
@ -6318,7 +6318,7 @@ emit_one_bundle (void)
int manual_bundling_off = 0, manual_bundling = 0; int manual_bundling_off = 0, manual_bundling = 0;
enum ia64_unit required_unit, insn_unit = 0; enum ia64_unit required_unit, insn_unit = 0;
enum ia64_insn_type type[3], insn_type; enum ia64_insn_type type[3], insn_type;
unsigned int template, orig_template; unsigned int template_val, orig_template;
bfd_vma insn[3] = { -1, -1, -1 }; bfd_vma insn[3] = { -1, -1, -1 };
struct ia64_opcode *idesc; struct ia64_opcode *idesc;
int end_of_insn_group = 0, user_template = -1; int end_of_insn_group = 0, user_template = -1;
@ -6340,7 +6340,7 @@ emit_one_bundle (void)
otherwise: */ otherwise: */
if (md.slot[first].user_template >= 0) if (md.slot[first].user_template >= 0)
user_template = template = md.slot[first].user_template; user_template = template_val = md.slot[first].user_template;
else else
{ {
/* Auto select appropriate template. */ /* Auto select appropriate template. */
@ -6353,12 +6353,12 @@ emit_one_bundle (void)
type[i] = md.slot[curr].idesc->type; type[i] = md.slot[curr].idesc->type;
curr = (curr + 1) % NUM_SLOTS; curr = (curr + 1) % NUM_SLOTS;
} }
template = best_template[type[0]][type[1]][type[2]]; template_val = best_template[type[0]][type[1]][type[2]];
} }
/* initialize instructions with appropriate nops: */ /* initialize instructions with appropriate nops: */
for (i = 0; i < 3; ++i) for (i = 0; i < 3; ++i)
insn[i] = nop[ia64_templ_desc[template].exec_unit[i]]; insn[i] = nop[ia64_templ_desc[template_val].exec_unit[i]];
f = frag_more (16); f = frag_more (16);
@ -6452,7 +6452,7 @@ emit_one_bundle (void)
MBB, BBB, MMB, and MFB. We don't handle anything other MBB, BBB, MMB, and MFB. We don't handle anything other
than M and B slots because these are the only kind of than M and B slots because these are the only kind of
instructions that can have the IA64_OPCODE_LAST bit set. */ instructions that can have the IA64_OPCODE_LAST bit set. */
required_template = template; required_template = template_val;
switch (idesc->type) switch (idesc->type)
{ {
case IA64_TYPE_M: case IA64_TYPE_M:
@ -6476,7 +6476,7 @@ emit_one_bundle (void)
|| (required_slot == 2 && !manual_bundling_off) || (required_slot == 2 && !manual_bundling_off)
|| (user_template >= 0 || (user_template >= 0
/* Changing from MMI to M;MI is OK. */ /* Changing from MMI to M;MI is OK. */
&& (template ^ required_template) > 1))) && (template_val ^ required_template) > 1)))
{ {
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
_("`%s' must be last in instruction group"), _("`%s' must be last in instruction group"),
@ -6489,7 +6489,7 @@ emit_one_bundle (void)
break; break;
i = required_slot; i = required_slot;
if (required_template != template) if (required_template != template_val)
{ {
/* If we switch the template, we need to reset the NOPs /* If we switch the template, we need to reset the NOPs
after slot i. The slot-types of the instructions ahead after slot i. The slot-types of the instructions ahead
@ -6502,7 +6502,7 @@ emit_one_bundle (void)
middle, so we don't need another one emitted later. */ middle, so we don't need another one emitted later. */
md.slot[curr].end_of_insn_group = 0; md.slot[curr].end_of_insn_group = 0;
} }
template = required_template; template_val = required_template;
} }
if (curr != first && md.slot[curr].label_fixups) if (curr != first && md.slot[curr].label_fixups)
{ {
@ -6522,18 +6522,18 @@ emit_one_bundle (void)
bundle. See if we can switch to an other template with bundle. See if we can switch to an other template with
an appropriate boundary. */ an appropriate boundary. */
orig_template = template; orig_template = template_val;
if (i == 1 && (user_template == 4 if (i == 1 && (user_template == 4
|| (user_template < 0 || (user_template < 0
&& (ia64_templ_desc[template].exec_unit[0] && (ia64_templ_desc[template_val].exec_unit[0]
== IA64_UNIT_M)))) == IA64_UNIT_M))))
{ {
template = 5; template_val = 5;
end_of_insn_group = 0; end_of_insn_group = 0;
} }
else if (i == 2 && (user_template == 0 else if (i == 2 && (user_template == 0
|| (user_template < 0 || (user_template < 0
&& (ia64_templ_desc[template].exec_unit[1] && (ia64_templ_desc[template_val].exec_unit[1]
== IA64_UNIT_I))) == IA64_UNIT_I)))
/* This test makes sure we don't switch the template if /* This test makes sure we don't switch the template if
the next instruction is one that needs to be first in the next instruction is one that needs to be first in
@ -6546,7 +6546,7 @@ emit_one_bundle (void)
first in the group! --davidm 99/12/16 */ first in the group! --davidm 99/12/16 */
&& (idesc->flags & IA64_OPCODE_FIRST) == 0) && (idesc->flags & IA64_OPCODE_FIRST) == 0)
{ {
template = 1; template_val = 1;
end_of_insn_group = 0; end_of_insn_group = 0;
} }
else if (i == 1 else if (i == 1
@ -6558,15 +6558,15 @@ emit_one_bundle (void)
/* can't fit this insn */ /* can't fit this insn */
break; break;
if (template != orig_template) if (template_val != orig_template)
/* if we switch the template, we need to reset the NOPs /* if we switch the template, we need to reset the NOPs
after slot i. The slot-types of the instructions ahead after slot i. The slot-types of the instructions ahead
of i never change, so we don't need to worry about of i never change, so we don't need to worry about
changing NOPs in front of this slot. */ changing NOPs in front of this slot. */
for (j = i; j < 3; ++j) for (j = i; j < 3; ++j)
insn[j] = nop[ia64_templ_desc[template].exec_unit[j]]; insn[j] = nop[ia64_templ_desc[template_val].exec_unit[j]];
} }
required_unit = ia64_templ_desc[template].exec_unit[i]; required_unit = ia64_templ_desc[template_val].exec_unit[i];
/* resolve dynamic opcodes such as "break", "hint", and "nop": */ /* resolve dynamic opcodes such as "break", "hint", and "nop": */
if (idesc->type == IA64_TYPE_DYN) if (idesc->type == IA64_TYPE_DYN)
@ -6607,7 +6607,7 @@ emit_one_bundle (void)
{ {
insn_unit = IA64_UNIT_M; insn_unit = IA64_UNIT_M;
if (required_unit == IA64_UNIT_I if (required_unit == IA64_UNIT_I
|| (required_unit == IA64_UNIT_F && template == 6)) || (required_unit == IA64_UNIT_F && template_val == 6))
insn_unit = IA64_UNIT_I; insn_unit = IA64_UNIT_I;
} }
else else
@ -6735,7 +6735,7 @@ emit_one_bundle (void)
{ {
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
_("`%s' does not fit into %s template"), _("`%s' does not fit into %s template"),
idesc->name, ia64_templ_desc[template].name); idesc->name, ia64_templ_desc[template_val].name);
/* Drop first insn so we don't livelock. */ /* Drop first insn so we don't livelock. */
--md.num_slots_in_use; --md.num_slots_in_use;
know (curr == first); know (curr == first);
@ -6754,7 +6754,7 @@ emit_one_bundle (void)
{ {
const char *where; const char *where;
if (template == 2) if (template_val == 2)
where = "X slot"; where = "X slot";
else if (last_slot == 0) else if (last_slot == 0)
where = "slots 2 or 3"; where = "slots 2 or 3";
@ -6762,7 +6762,7 @@ emit_one_bundle (void)
where = "slot 3"; where = "slot 3";
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
_("`%s' can't go in %s of %s template"), _("`%s' can't go in %s of %s template"),
idesc->name, where, ia64_templ_desc[template].name); idesc->name, where, ia64_templ_desc[template_val].name);
} }
} }
else else
@ -6772,7 +6772,7 @@ emit_one_bundle (void)
know (md.num_slots_in_use < NUM_SLOTS); know (md.num_slots_in_use < NUM_SLOTS);
t0 = end_of_insn_group | (template << 1) | (insn[0] << 5) | (insn[1] << 46); t0 = end_of_insn_group | (template_val << 1) | (insn[0] << 5) | (insn[1] << 46);
t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23); t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23);
number_to_chars_littleendian (f + 0, t0, 8); number_to_chars_littleendian (f + 0, t0, 8);
@ -10861,7 +10861,7 @@ ia64_cons_fix_new (fragS *f, int where, int nbytes, expressionS *exp)
static bfd_reloc_code_real_type static bfd_reloc_code_real_type
ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type) ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
{ {
bfd_reloc_code_real_type new = 0; bfd_reloc_code_real_type newr = 0;
const char *type = NULL, *suffix = ""; const char *type = NULL, *suffix = "";
if (sym == NULL) if (sym == NULL)
@ -10874,11 +10874,11 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_FPTR_RELATIVE: case FUNC_FPTR_RELATIVE:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_FPTR64I; break; case BFD_RELOC_IA64_IMM64: newr = BFD_RELOC_IA64_FPTR64I; break;
case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_FPTR32MSB; break; case BFD_RELOC_IA64_DIR32MSB: newr = BFD_RELOC_IA64_FPTR32MSB; break;
case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_FPTR32LSB; break; case BFD_RELOC_IA64_DIR32LSB: newr = BFD_RELOC_IA64_FPTR32LSB; break;
case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_FPTR64MSB; break; case BFD_RELOC_IA64_DIR64MSB: newr = BFD_RELOC_IA64_FPTR64MSB; break;
case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_FPTR64LSB; break; case BFD_RELOC_IA64_DIR64LSB: newr = BFD_RELOC_IA64_FPTR64LSB; break;
default: type = "FPTR"; break; default: type = "FPTR"; break;
} }
break; break;
@ -10886,12 +10886,12 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_GP_RELATIVE: case FUNC_GP_RELATIVE:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_GPREL22; break; case BFD_RELOC_IA64_IMM22: newr = BFD_RELOC_IA64_GPREL22; break;
case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_GPREL64I; break; case BFD_RELOC_IA64_IMM64: newr = BFD_RELOC_IA64_GPREL64I; break;
case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_GPREL32MSB; break; case BFD_RELOC_IA64_DIR32MSB: newr = BFD_RELOC_IA64_GPREL32MSB; break;
case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_GPREL32LSB; break; case BFD_RELOC_IA64_DIR32LSB: newr = BFD_RELOC_IA64_GPREL32LSB; break;
case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_GPREL64MSB; break; case BFD_RELOC_IA64_DIR64MSB: newr = BFD_RELOC_IA64_GPREL64MSB; break;
case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_GPREL64LSB; break; case BFD_RELOC_IA64_DIR64LSB: newr = BFD_RELOC_IA64_GPREL64LSB; break;
default: type = "GPREL"; break; default: type = "GPREL"; break;
} }
break; break;
@ -10899,8 +10899,8 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_LT_RELATIVE: case FUNC_LT_RELATIVE:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_LTOFF22; break; case BFD_RELOC_IA64_IMM22: newr = BFD_RELOC_IA64_LTOFF22; break;
case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_LTOFF64I; break; case BFD_RELOC_IA64_IMM64: newr = BFD_RELOC_IA64_LTOFF64I; break;
default: type = "LTOFF"; break; default: type = "LTOFF"; break;
} }
break; break;
@ -10908,7 +10908,7 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_LT_RELATIVE_X: case FUNC_LT_RELATIVE_X:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_LTOFF22X; break; case BFD_RELOC_IA64_IMM22: newr = BFD_RELOC_IA64_LTOFF22X; break;
default: type = "LTOFF"; suffix = "X"; break; default: type = "LTOFF"; suffix = "X"; break;
} }
break; break;
@ -10916,12 +10916,12 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_PC_RELATIVE: case FUNC_PC_RELATIVE:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_PCREL22; break; case BFD_RELOC_IA64_IMM22: newr = BFD_RELOC_IA64_PCREL22; break;
case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_PCREL64I; break; case BFD_RELOC_IA64_IMM64: newr = BFD_RELOC_IA64_PCREL64I; break;
case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_PCREL32MSB; break; case BFD_RELOC_IA64_DIR32MSB: newr = BFD_RELOC_IA64_PCREL32MSB; break;
case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_PCREL32LSB; break; case BFD_RELOC_IA64_DIR32LSB: newr = BFD_RELOC_IA64_PCREL32LSB; break;
case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_PCREL64MSB; break; case BFD_RELOC_IA64_DIR64MSB: newr = BFD_RELOC_IA64_PCREL64MSB; break;
case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_PCREL64LSB; break; case BFD_RELOC_IA64_DIR64LSB: newr = BFD_RELOC_IA64_PCREL64LSB; break;
default: type = "PCREL"; break; default: type = "PCREL"; break;
} }
break; break;
@ -10929,10 +10929,10 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_PLT_RELATIVE: case FUNC_PLT_RELATIVE:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_PLTOFF22; break; case BFD_RELOC_IA64_IMM22: newr = BFD_RELOC_IA64_PLTOFF22; break;
case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_PLTOFF64I; break; case BFD_RELOC_IA64_IMM64: newr = BFD_RELOC_IA64_PLTOFF64I; break;
case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_PLTOFF64MSB;break; case BFD_RELOC_IA64_DIR64MSB: newr = BFD_RELOC_IA64_PLTOFF64MSB;break;
case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_PLTOFF64LSB;break; case BFD_RELOC_IA64_DIR64LSB: newr = BFD_RELOC_IA64_PLTOFF64LSB;break;
default: type = "PLTOFF"; break; default: type = "PLTOFF"; break;
} }
break; break;
@ -10940,10 +10940,10 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_SEC_RELATIVE: case FUNC_SEC_RELATIVE:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_SECREL32MSB;break; case BFD_RELOC_IA64_DIR32MSB: newr = BFD_RELOC_IA64_SECREL32MSB;break;
case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_SECREL32LSB;break; case BFD_RELOC_IA64_DIR32LSB: newr = BFD_RELOC_IA64_SECREL32LSB;break;
case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_SECREL64MSB;break; case BFD_RELOC_IA64_DIR64MSB: newr = BFD_RELOC_IA64_SECREL64MSB;break;
case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_SECREL64LSB;break; case BFD_RELOC_IA64_DIR64LSB: newr = BFD_RELOC_IA64_SECREL64LSB;break;
default: type = "SECREL"; break; default: type = "SECREL"; break;
} }
break; break;
@ -10951,10 +10951,10 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_SEG_RELATIVE: case FUNC_SEG_RELATIVE:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_SEGREL32MSB;break; case BFD_RELOC_IA64_DIR32MSB: newr = BFD_RELOC_IA64_SEGREL32MSB;break;
case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_SEGREL32LSB;break; case BFD_RELOC_IA64_DIR32LSB: newr = BFD_RELOC_IA64_SEGREL32LSB;break;
case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_SEGREL64MSB;break; case BFD_RELOC_IA64_DIR64MSB: newr = BFD_RELOC_IA64_SEGREL64MSB;break;
case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_SEGREL64LSB;break; case BFD_RELOC_IA64_DIR64LSB: newr = BFD_RELOC_IA64_SEGREL64LSB;break;
default: type = "SEGREL"; break; default: type = "SEGREL"; break;
} }
break; break;
@ -10962,10 +10962,10 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_LTV_RELATIVE: case FUNC_LTV_RELATIVE:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_LTV32MSB; break; case BFD_RELOC_IA64_DIR32MSB: newr = BFD_RELOC_IA64_LTV32MSB; break;
case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_LTV32LSB; break; case BFD_RELOC_IA64_DIR32LSB: newr = BFD_RELOC_IA64_LTV32LSB; break;
case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_LTV64MSB; break; case BFD_RELOC_IA64_DIR64MSB: newr = BFD_RELOC_IA64_LTV64MSB; break;
case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_LTV64LSB; break; case BFD_RELOC_IA64_DIR64LSB: newr = BFD_RELOC_IA64_LTV64LSB; break;
default: type = "LTV"; break; default: type = "LTV"; break;
} }
break; break;
@ -10974,17 +10974,17 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM22: case BFD_RELOC_IA64_IMM22:
new = BFD_RELOC_IA64_LTOFF_FPTR22; break; newr = BFD_RELOC_IA64_LTOFF_FPTR22; break;
case BFD_RELOC_IA64_IMM64: case BFD_RELOC_IA64_IMM64:
new = BFD_RELOC_IA64_LTOFF_FPTR64I; break; newr = BFD_RELOC_IA64_LTOFF_FPTR64I; break;
case BFD_RELOC_IA64_DIR32MSB: case BFD_RELOC_IA64_DIR32MSB:
new = BFD_RELOC_IA64_LTOFF_FPTR32MSB; break; newr = BFD_RELOC_IA64_LTOFF_FPTR32MSB; break;
case BFD_RELOC_IA64_DIR32LSB: case BFD_RELOC_IA64_DIR32LSB:
new = BFD_RELOC_IA64_LTOFF_FPTR32LSB; break; newr = BFD_RELOC_IA64_LTOFF_FPTR32LSB; break;
case BFD_RELOC_IA64_DIR64MSB: case BFD_RELOC_IA64_DIR64MSB:
new = BFD_RELOC_IA64_LTOFF_FPTR64MSB; break; newr = BFD_RELOC_IA64_LTOFF_FPTR64MSB; break;
case BFD_RELOC_IA64_DIR64LSB: case BFD_RELOC_IA64_DIR64LSB:
new = BFD_RELOC_IA64_LTOFF_FPTR64LSB; break; newr = BFD_RELOC_IA64_LTOFF_FPTR64LSB; break;
default: default:
type = "LTOFF_FPTR"; break; type = "LTOFF_FPTR"; break;
} }
@ -10993,11 +10993,11 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
case FUNC_TP_RELATIVE: case FUNC_TP_RELATIVE:
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM14: new = BFD_RELOC_IA64_TPREL14; break; case BFD_RELOC_IA64_IMM14: newr = BFD_RELOC_IA64_TPREL14; break;
case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_TPREL22; break; case BFD_RELOC_IA64_IMM22: newr = BFD_RELOC_IA64_TPREL22; break;
case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_TPREL64I; break; case BFD_RELOC_IA64_IMM64: newr = BFD_RELOC_IA64_TPREL64I; break;
case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_TPREL64MSB; break; case BFD_RELOC_IA64_DIR64MSB: newr = BFD_RELOC_IA64_TPREL64MSB; break;
case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_TPREL64LSB; break; case BFD_RELOC_IA64_DIR64LSB: newr = BFD_RELOC_IA64_TPREL64LSB; break;
default: type = "TPREL"; break; default: type = "TPREL"; break;
} }
break; break;
@ -11006,7 +11006,7 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM22: case BFD_RELOC_IA64_IMM22:
new = BFD_RELOC_IA64_LTOFF_TPREL22; break; newr = BFD_RELOC_IA64_LTOFF_TPREL22; break;
default: default:
type = "LTOFF_TPREL"; break; type = "LTOFF_TPREL"; break;
} }
@ -11016,9 +11016,9 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_DIR64MSB: case BFD_RELOC_IA64_DIR64MSB:
new = BFD_RELOC_IA64_DTPMOD64MSB; break; newr = BFD_RELOC_IA64_DTPMOD64MSB; break;
case BFD_RELOC_IA64_DIR64LSB: case BFD_RELOC_IA64_DIR64LSB:
new = BFD_RELOC_IA64_DTPMOD64LSB; break; newr = BFD_RELOC_IA64_DTPMOD64LSB; break;
default: default:
type = "DTPMOD"; break; type = "DTPMOD"; break;
} }
@ -11028,7 +11028,7 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM22: case BFD_RELOC_IA64_IMM22:
new = BFD_RELOC_IA64_LTOFF_DTPMOD22; break; newr = BFD_RELOC_IA64_LTOFF_DTPMOD22; break;
default: default:
type = "LTOFF_DTPMOD"; break; type = "LTOFF_DTPMOD"; break;
} }
@ -11038,19 +11038,19 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_DIR32MSB: case BFD_RELOC_IA64_DIR32MSB:
new = BFD_RELOC_IA64_DTPREL32MSB; break; newr = BFD_RELOC_IA64_DTPREL32MSB; break;
case BFD_RELOC_IA64_DIR32LSB: case BFD_RELOC_IA64_DIR32LSB:
new = BFD_RELOC_IA64_DTPREL32LSB; break; newr = BFD_RELOC_IA64_DTPREL32LSB; break;
case BFD_RELOC_IA64_DIR64MSB: case BFD_RELOC_IA64_DIR64MSB:
new = BFD_RELOC_IA64_DTPREL64MSB; break; newr = BFD_RELOC_IA64_DTPREL64MSB; break;
case BFD_RELOC_IA64_DIR64LSB: case BFD_RELOC_IA64_DIR64LSB:
new = BFD_RELOC_IA64_DTPREL64LSB; break; newr = BFD_RELOC_IA64_DTPREL64LSB; break;
case BFD_RELOC_IA64_IMM14: case BFD_RELOC_IA64_IMM14:
new = BFD_RELOC_IA64_DTPREL14; break; newr = BFD_RELOC_IA64_DTPREL14; break;
case BFD_RELOC_IA64_IMM22: case BFD_RELOC_IA64_IMM22:
new = BFD_RELOC_IA64_DTPREL22; break; newr = BFD_RELOC_IA64_DTPREL22; break;
case BFD_RELOC_IA64_IMM64: case BFD_RELOC_IA64_IMM64:
new = BFD_RELOC_IA64_DTPREL64I; break; newr = BFD_RELOC_IA64_DTPREL64I; break;
default: default:
type = "DTPREL"; break; type = "DTPREL"; break;
} }
@ -11060,7 +11060,7 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_IA64_IMM22: case BFD_RELOC_IA64_IMM22:
new = BFD_RELOC_IA64_LTOFF_DTPREL22; break; newr = BFD_RELOC_IA64_LTOFF_DTPREL22; break;
default: default:
type = "LTOFF_DTPREL"; break; type = "LTOFF_DTPREL"; break;
} }
@ -11079,8 +11079,8 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
abort (); abort ();
} }
if (new) if (newr)
return new; return newr;
else else
{ {
int width; int width;

View File

@ -647,7 +647,7 @@ static char *
parse_exp (char * s, expressionS * e) parse_exp (char * s, expressionS * e)
{ {
char * save; char * save;
char * new; char * new_pointer;
/* Skip whitespace. */ /* Skip whitespace. */
while (ISSPACE (* s)) while (ISSPACE (* s))
@ -661,10 +661,10 @@ parse_exp (char * s, expressionS * e)
if (e->X_op == O_absent) if (e->X_op == O_absent)
as_bad (_("missing operand")); as_bad (_("missing operand"));
new = input_line_pointer; new_pointer = input_line_pointer;
input_line_pointer = save; input_line_pointer = save;
return new; return new_pointer;
} }
static int static int
@ -771,10 +771,10 @@ parse_imm (char * s,
unsigned min, unsigned min,
unsigned max) unsigned max)
{ {
char * new; char * new_pointer;
expressionS e; expressionS e;
new = parse_exp (s, & e); new_pointer = parse_exp (s, & e);
if (e.X_op == O_absent) if (e.X_op == O_absent)
; /* An error message has already been emitted. */ ; /* An error message has already been emitted. */
@ -786,7 +786,7 @@ parse_imm (char * s,
* val = e.X_add_number; * val = e.X_add_number;
return new; return new_pointer;
} }
static char * static char *

View File

@ -568,7 +568,7 @@ static char *
parse_exp (char *s, expressionS *e) parse_exp (char *s, expressionS *e)
{ {
char *save; char *save;
char *new; char *new_pointer;
/* Skip whitespace. */ /* Skip whitespace. */
while (ISSPACE (* s)) while (ISSPACE (* s))
@ -582,10 +582,10 @@ parse_exp (char *s, expressionS *e)
if (e->X_op == O_absent) if (e->X_op == O_absent)
as_fatal (_("missing operand")); as_fatal (_("missing operand"));
new = input_line_pointer; new_pointer = input_line_pointer;
input_line_pointer = save; input_line_pointer = save;
return new; return new_pointer;
} }
/* Symbol modifiers (@GOT, @PLT, @GOTOFF). */ /* Symbol modifiers (@GOT, @PLT, @GOTOFF). */
@ -600,7 +600,7 @@ static symbolS * GOT_symbol;
static char * static char *
parse_imm (char * s, expressionS * e, int min, int max) parse_imm (char * s, expressionS * e, int min, int max)
{ {
char *new; char *new_pointer;
char *atp; char *atp;
/* Find the start of "@GOT" or "@PLT" suffix (if any) */ /* Find the start of "@GOT" or "@PLT" suffix (if any) */
@ -643,7 +643,7 @@ parse_imm (char * s, expressionS * e, int min, int max)
GOT_symbol = symbol_find_or_make (GOT_SYMBOL_NAME); GOT_symbol = symbol_find_or_make (GOT_SYMBOL_NAME);
} }
new = parse_exp (s, e); new_pointer = parse_exp (s, e);
if (e->X_op == O_absent) if (e->X_op == O_absent)
; /* An error message has already been emitted. */ ; /* An error message has already been emitted. */
@ -659,18 +659,18 @@ parse_imm (char * s, expressionS * e, int min, int max)
if (atp) if (atp)
{ {
*atp = '@'; /* restore back (needed?) */ *atp = '@'; /* restore back (needed?) */
if (new >= atp) if (new_pointer >= atp)
new += (e->X_md == IMM_GOTOFF)?7:4; new_pointer += (e->X_md == IMM_GOTOFF)?7:4;
/* sizeof("@GOTOFF", "@GOT" or "@PLT") */ /* sizeof("@GOTOFF", "@GOT" or "@PLT") */
} }
return new; return new_pointer;
} }
static char * static char *
check_got (int * got_type, int * got_len) check_got (int * got_type, int * got_len)
{ {
char *new; char *new_pointer;
char *atp; char *atp;
char *past_got; char *past_got;
int first, second; int first, second;
@ -705,9 +705,9 @@ check_got (int * got_type, int * got_len)
first = atp - input_line_pointer; first = atp - input_line_pointer;
past_got = atp + *got_len + 1; past_got = atp + *got_len + 1;
for (new = past_got; !is_end_of_line[(unsigned char) *new++]; ) for (new_pointer = past_got; !is_end_of_line[(unsigned char) *new_pointer++];)
; ;
second = new - past_got; second = new_pointer - past_got;
tmpbuf = xmalloc (first + second + 2); /* One extra byte for ' ' and one for NUL. */ tmpbuf = xmalloc (first + second + 2); /* One extra byte for ' ' and one for NUL. */
memcpy (tmpbuf, input_line_pointer, first); memcpy (tmpbuf, input_line_pointer, first);
tmpbuf[first] = ' '; /* @GOTOFF is replaced with a single space. */ tmpbuf[first] = ' '; /* @GOTOFF is replaced with a single space. */

View File

@ -262,7 +262,7 @@ static char *
parse_operand (char *s, expressionS *operandp, int opt) parse_operand (char *s, expressionS *operandp, int opt)
{ {
char *save = input_line_pointer; char *save = input_line_pointer;
char *new; char *new_pointer;
#if DEBUG #if DEBUG
printf (" PROCESS NEW OPERAND(%s) == %c (%d)\n", s, opt ? opt : '!', opt); printf (" PROCESS NEW OPERAND(%s) == %c (%d)\n", s, opt ? opt : '!', opt);
@ -312,14 +312,15 @@ parse_operand (char *s, expressionS *operandp, int opt)
} }
} }
new = input_line_pointer; new_pointer = input_line_pointer;
input_line_pointer = save; input_line_pointer = save;
#if DEBUG #if DEBUG
printf (" %s=parse_operand(%s): operandp->X_op = %u\n", new, s, operandp->X_op); printf (" %s=parse_operand(%s): operandp->X_op = %u\n", new_pointer, s,
operandp->X_op);
#endif #endif
return new; return new_pointer;
} }
/* Instruction parsing. Takes a string containing the opcode. /* Instruction parsing. Takes a string containing the opcode.

View File

@ -752,8 +752,8 @@ md_assemble (char *instruction_string)
case PDP11_OPCODE_DISPL: case PDP11_OPCODE_DISPL:
{ {
char *new; char *new_pointer;
new = parse_expression (str, &op1); new_pointer = parse_expression (str, &op1);
op1.code = 0; op1.code = 0;
op1.reloc.pc_rel = 1; op1.reloc.pc_rel = 1;
op1.reloc.type = BFD_RELOC_PDP11_DISP_8_PCREL; op1.reloc.type = BFD_RELOC_PDP11_DISP_8_PCREL;
@ -767,7 +767,7 @@ md_assemble (char *instruction_string)
err = _("8-bit displacement out of range"); err = _("8-bit displacement out of range");
break; break;
} }
str = new; str = new_pointer;
insn.code |= op1.code; insn.code |= op1.code;
insn.reloc = op1.reloc; insn.reloc = op1.reloc;
} }
@ -935,7 +935,7 @@ md_assemble (char *instruction_string)
case PDP11_OPCODE_REG_DISPL: case PDP11_OPCODE_REG_DISPL:
{ {
char *new; char *new_pointer;
str = parse_reg (str, &op2); str = parse_reg (str, &op2);
if (op2.error) if (op2.error)
break; break;
@ -946,7 +946,7 @@ md_assemble (char *instruction_string)
op1.error = _("Missing ','"); op1.error = _("Missing ','");
break; break;
} }
new = parse_expression (str, &op1); new_pointer = parse_expression (str, &op1);
op1.code = 0; op1.code = 0;
op1.reloc.pc_rel = 1; op1.reloc.pc_rel = 1;
op1.reloc.type = BFD_RELOC_PDP11_DISP_6_PCREL; op1.reloc.type = BFD_RELOC_PDP11_DISP_6_PCREL;
@ -960,7 +960,7 @@ md_assemble (char *instruction_string)
err = _("6-bit displacement out of range"); err = _("6-bit displacement out of range");
break; break;
} }
str = new; str = new_pointer;
insn.code |= op1.code; insn.code |= op1.code;
insn.reloc = op1.reloc; insn.reloc = op1.reloc;
} }

View File

@ -183,9 +183,9 @@ fake_opcode (const char *name,
can have another name. */ can have another name. */
static void static void
alias (const char *new, const char *old) alias (const char *new_name, const char *old)
{ {
hash_insert (opcode_hash_control, new, hash_insert (opcode_hash_control, new_name,
(char *) hash_find (opcode_hash_control, old)); (char *) hash_find (opcode_hash_control, old));
} }

View File

@ -539,7 +539,7 @@ static struct s3_datafield_range s3_score_df_range[] =
struct s3_asm_opcode struct s3_asm_opcode
{ {
/* Instruction name. */ /* Instruction name. */
const char *template; const char *template_name;
/* Instruction Opcode. */ /* Instruction Opcode. */
bfd_vma value; bfd_vma value;
@ -2681,7 +2681,7 @@ s3_parse_16_32_inst (char *insnstr, bfd_boolean gen_frag_p)
s3_inst.size = s3_GET_INSN_SIZE (s3_inst.type); s3_inst.size = s3_GET_INSN_SIZE (s3_inst.type);
s3_inst.relax_size = 0; s3_inst.relax_size = 0;
s3_inst.bwarn = 0; s3_inst.bwarn = 0;
sprintf (s3_inst.name, "%s", opcode->template); sprintf (s3_inst.name, "%s", opcode->template_name);
strcpy (s3_inst.reg, ""); strcpy (s3_inst.reg, "");
s3_inst.error = NULL; s3_inst.error = NULL;
s3_inst.reloc.type = BFD_RELOC_NONE; s3_inst.reloc.type = BFD_RELOC_NONE;
@ -2727,7 +2727,7 @@ s3_parse_48_inst (char *insnstr, bfd_boolean gen_frag_p)
s3_inst.size = s3_GET_INSN_SIZE (s3_inst.type); s3_inst.size = s3_GET_INSN_SIZE (s3_inst.type);
s3_inst.relax_size = 0; s3_inst.relax_size = 0;
s3_inst.bwarn = 0; s3_inst.bwarn = 0;
sprintf (s3_inst.name, "%s", opcode->template); sprintf (s3_inst.name, "%s", opcode->template_name);
strcpy (s3_inst.reg, ""); strcpy (s3_inst.reg, "");
s3_inst.error = NULL; s3_inst.error = NULL;
s3_inst.reloc.type = BFD_RELOC_NONE; s3_inst.reloc.type = BFD_RELOC_NONE;
@ -4993,7 +4993,8 @@ s3_do_macro_ldst_label (char *str)
{ {
int ldst_idx = 0; int ldst_idx = 0;
ldst_idx = s3_inst.instruction & OPC_PSEUDOLDST_MASK; ldst_idx = s3_inst.instruction & OPC_PSEUDOLDST_MASK;
s3_build_lwst_pic (reg_rd, s3_inst.reloc.exp, s3_score_ldst_insns[ldst_idx * 3 + 0].template); s3_build_lwst_pic (reg_rd, s3_inst.reloc.exp,
s3_score_ldst_insns[ldst_idx * 3 + 0].template_name);
return; return;
} }
else else
@ -6319,20 +6320,22 @@ s3_build_score_ops_hsh (void)
for (i = 0; i < sizeof (s3_score_insns) / sizeof (struct s3_asm_opcode); i++) for (i = 0; i < sizeof (s3_score_insns) / sizeof (struct s3_asm_opcode); i++)
{ {
const struct s3_asm_opcode *insn = s3_score_insns + i; const struct s3_asm_opcode *insn = s3_score_insns + i;
unsigned len = strlen (insn->template); unsigned len = strlen (insn->template_name);
struct s3_asm_opcode *new; struct s3_asm_opcode *new_opcode;
char *template; char *template_name;
new = obstack_alloc (&insn_obstack, sizeof (struct s3_asm_opcode)); new_opcode = (struct s3_asm_opcode *)
template = obstack_alloc (&insn_obstack, len + 1); obstack_alloc (&insn_obstack, sizeof (struct s3_asm_opcode));
template_name = (char *) obstack_alloc (& insn_obstack, len + 1);
strcpy (template, insn->template); strcpy (template_name, insn->template_name);
new->template = template; new_opcode->template_name = template_name;
new->parms = insn->parms; new_opcode->parms = insn->parms;
new->value = insn->value; new_opcode->value = insn->value;
new->relax_value = insn->relax_value; new_opcode->relax_value = insn->relax_value;
new->type = insn->type; new_opcode->type = insn->type;
new->bitmask = insn->bitmask; new_opcode->bitmask = insn->bitmask;
hash_insert (s3_score_ops_hsh, new->template, (void *) new); hash_insert (s3_score_ops_hsh, new_opcode->template_name,
(void *) new_opcode);
} }
} }
@ -6347,14 +6350,18 @@ s3_build_dependency_insn_hsh (void)
{ {
const struct s3_insn_to_dependency *tmp = s3_insn_to_dependency_table + i; const struct s3_insn_to_dependency *tmp = s3_insn_to_dependency_table + i;
unsigned len = strlen (tmp->insn_name); unsigned len = strlen (tmp->insn_name);
struct s3_insn_to_dependency *new; struct s3_insn_to_dependency *new_i2n;
new = obstack_alloc (&dependency_obstack, sizeof (struct s3_insn_to_dependency)); new_i2n = (struct s3_insn_to_dependency *)
new->insn_name = obstack_alloc (&dependency_obstack, len + 1); obstack_alloc (&dependency_obstack,
sizeof (struct s3_insn_to_dependency));
new_i2n->insn_name = (char *) obstack_alloc (&dependency_obstack,
len + 1);
strcpy (new->insn_name, tmp->insn_name); strcpy (new_i2n->insn_name, tmp->insn_name);
new->type = tmp->type; new_i2n->type = tmp->type;
hash_insert (s3_dependency_insn_hsh, new->insn_name, (void *) new); hash_insert (s3_dependency_insn_hsh, new_i2n->insn_name,
(void *) new_i2n);
} }
} }
@ -7023,28 +7030,28 @@ s3_relax_frag (asection * sec ATTRIBUTE_UNUSED, fragS * fragp, long stretch ATTR
static void static void
s3_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp) s3_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp)
{ {
int old; int r_old;
int new; int r_new;
char backup[20]; char backup[20];
fixS *fixp; fixS *fixp;
old = s3_RELAX_OLD (fragp->fr_subtype); r_old = s3_RELAX_OLD (fragp->fr_subtype);
new = s3_RELAX_NEW (fragp->fr_subtype); r_new = s3_RELAX_NEW (fragp->fr_subtype);
/* fragp->fr_opcode indicates whether this frag should be relaxed. */ /* fragp->fr_opcode indicates whether this frag should be relaxed. */
if (fragp->fr_opcode == NULL) if (fragp->fr_opcode == NULL)
{ {
memcpy (backup, fragp->fr_literal, old); memcpy (backup, fragp->fr_literal, r_old);
fragp->fr_fix = old; fragp->fr_fix = r_old;
} }
else else
{ {
memcpy (backup, fragp->fr_literal + old, new); memcpy (backup, fragp->fr_literal + r_old, r_new);
fragp->fr_fix = new; fragp->fr_fix = r_new;
} }
fixp = fragp->tc_frag_data.fixp; fixp = fragp->tc_frag_data.fixp;
while (fixp && fixp->fx_frag == fragp && fixp->fx_where < old) while (fixp && fixp->fx_frag == fragp && fixp->fx_where < r_old)
{ {
if (fragp->fr_opcode) if (fragp->fr_opcode)
fixp->fx_done = 1; fixp->fx_done = 1;
@ -7053,7 +7060,7 @@ s3_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS *
while (fixp && fixp->fx_frag == fragp) while (fixp && fixp->fx_frag == fragp)
{ {
if (fragp->fr_opcode) if (fragp->fr_opcode)
fixp->fx_where -= old + fragp->insn_addr; fixp->fx_where -= r_old + fragp->insn_addr;
else else
fixp->fx_done = 1; fixp->fx_done = 1;
fixp = fixp->fx_next; fixp = fixp->fx_next;

View File

@ -597,7 +597,7 @@ static struct s7_datafield_range s7_score_df_range[] =
struct s7_asm_opcode struct s7_asm_opcode
{ {
/* Instruction name. */ /* Instruction name. */
const char *template; const char *template_name;
/* Instruction Opcode. */ /* Instruction Opcode. */
bfd_vma value; bfd_vma value;
@ -2804,7 +2804,7 @@ s7_parse_16_32_inst (char *insnstr, bfd_boolean gen_frag_p)
s7_inst.size = s7_GET_INSN_SIZE (s7_inst.type); s7_inst.size = s7_GET_INSN_SIZE (s7_inst.type);
s7_inst.relax_size = 0; s7_inst.relax_size = 0;
s7_inst.bwarn = 0; s7_inst.bwarn = 0;
sprintf (s7_inst.name, "%s", opcode->template); sprintf (s7_inst.name, "%s", opcode->template_name);
strcpy (s7_inst.reg, ""); strcpy (s7_inst.reg, "");
s7_inst.error = NULL; s7_inst.error = NULL;
s7_inst.reloc.type = BFD_RELOC_NONE; s7_inst.reloc.type = BFD_RELOC_NONE;
@ -4789,7 +4789,8 @@ s7_do_macro_ldst_label (char *str)
{ {
int ldst_idx = 0; int ldst_idx = 0;
ldst_idx = s7_inst.instruction & OPC_PSEUDOLDST_MASK; ldst_idx = s7_inst.instruction & OPC_PSEUDOLDST_MASK;
s7_build_lwst_pic (reg_rd, s7_inst.reloc.exp, s7_score_ldst_insns[ldst_idx * 3 + 0].template); s7_build_lwst_pic (reg_rd, s7_inst.reloc.exp,
s7_score_ldst_insns[ldst_idx * 3 + 0].template_name);
return; return;
} }
else else
@ -5092,20 +5093,22 @@ s7_build_score_ops_hsh (void)
for (i = 0; i < sizeof (s7_score_insns) / sizeof (struct s7_asm_opcode); i++) for (i = 0; i < sizeof (s7_score_insns) / sizeof (struct s7_asm_opcode); i++)
{ {
const struct s7_asm_opcode *insn = s7_score_insns + i; const struct s7_asm_opcode *insn = s7_score_insns + i;
unsigned len = strlen (insn->template); unsigned len = strlen (insn->template_name);
struct s7_asm_opcode *new; struct s7_asm_opcode *new_opcode;
char *template; char *template_name;
new = obstack_alloc (&insn_obstack, sizeof (struct s7_asm_opcode)); new_opcode = (struct s7_asm_opcode *)
template = obstack_alloc (&insn_obstack, len + 1); obstack_alloc (&insn_obstack, sizeof (struct s7_asm_opcode));
template_name = (char *) obstack_alloc (&insn_obstack, len + 1);
strcpy (template, insn->template); strcpy (template_name, insn->template_name);
new->template = template; new_opcode->template_name = template_name;
new->parms = insn->parms; new_opcode->parms = insn->parms;
new->value = insn->value; new_opcode->value = insn->value;
new->relax_value = insn->relax_value; new_opcode->relax_value = insn->relax_value;
new->type = insn->type; new_opcode->type = insn->type;
new->bitmask = insn->bitmask; new_opcode->bitmask = insn->bitmask;
hash_insert (s7_score_ops_hsh, new->template, (void *) new); hash_insert (s7_score_ops_hsh, new_opcode->template_name,
(void *) new_opcode);
} }
} }
@ -5120,14 +5123,18 @@ s7_build_dependency_insn_hsh (void)
{ {
const struct s7_insn_to_dependency *tmp = s7_insn_to_dependency_table + i; const struct s7_insn_to_dependency *tmp = s7_insn_to_dependency_table + i;
unsigned len = strlen (tmp->insn_name); unsigned len = strlen (tmp->insn_name);
struct s7_insn_to_dependency *new; struct s7_insn_to_dependency *new_i2d;
new = obstack_alloc (&dependency_obstack, sizeof (struct s7_insn_to_dependency)); new_i2d = (struct s7_insn_to_dependency *)
new->insn_name = obstack_alloc (&dependency_obstack, len + 1); obstack_alloc (&dependency_obstack,
sizeof (struct s7_insn_to_dependency));
new_i2d->insn_name = (char *) obstack_alloc (&dependency_obstack,
len + 1);
strcpy (new->insn_name, tmp->insn_name); strcpy (new_i2d->insn_name, tmp->insn_name);
new->type = tmp->type; new_i2d->type = tmp->type;
hash_insert (s7_dependency_insn_hsh, new->insn_name, (void *) new); hash_insert (s7_dependency_insn_hsh, new_i2d->insn_name,
(void *) new_i2d);
} }
} }
@ -5238,8 +5245,8 @@ s7_b32_relax_to_b16 (fragS * fragp)
{ {
int grows = 0; int grows = 0;
int relaxable_p = 0; int relaxable_p = 0;
int old; int r_old;
int new; int r_new;
int frag_addr = fragp->fr_address + fragp->insn_addr; int frag_addr = fragp->fr_address + fragp->insn_addr;
addressT symbol_address = 0; addressT symbol_address = 0;
@ -5253,8 +5260,8 @@ s7_b32_relax_to_b16 (fragS * fragp)
so in relax stage , it may be wrong to calculate the symbol's offset when the frag's section so in relax stage , it may be wrong to calculate the symbol's offset when the frag's section
is different from the symbol's. */ is different from the symbol's. */
old = s7_RELAX_OLD (fragp->fr_subtype); r_old = s7_RELAX_OLD (fragp->fr_subtype);
new = s7_RELAX_NEW (fragp->fr_subtype); r_new = s7_RELAX_NEW (fragp->fr_subtype);
relaxable_p = s7_RELAX_OPT (fragp->fr_subtype); relaxable_p = s7_RELAX_OPT (fragp->fr_subtype);
s = fragp->fr_symbol; s = fragp->fr_symbol;
@ -6575,28 +6582,28 @@ s7_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
segT sec ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED,
fragS * fragp) fragS * fragp)
{ {
int old; int r_old;
int new; int r_new;
char backup[20]; char backup[20];
fixS *fixp; fixS *fixp;
old = s7_RELAX_OLD (fragp->fr_subtype); r_old = s7_RELAX_OLD (fragp->fr_subtype);
new = s7_RELAX_NEW (fragp->fr_subtype); r_new = s7_RELAX_NEW (fragp->fr_subtype);
/* fragp->fr_opcode indicates whether this frag should be relaxed. */ /* fragp->fr_opcode indicates whether this frag should be relaxed. */
if (fragp->fr_opcode == NULL) if (fragp->fr_opcode == NULL)
{ {
memcpy (backup, fragp->fr_literal, old); memcpy (backup, fragp->fr_literal, r_old);
fragp->fr_fix = old; fragp->fr_fix = r_old;
} }
else else
{ {
memcpy (backup, fragp->fr_literal + old, new); memcpy (backup, fragp->fr_literal + r_old, r_new);
fragp->fr_fix = new; fragp->fr_fix = r_new;
} }
fixp = fragp->tc_frag_data.fixp; fixp = fragp->tc_frag_data.fixp;
while (fixp && fixp->fx_frag == fragp && fixp->fx_where < old) while (fixp && fixp->fx_frag == fragp && fixp->fx_where < r_old)
{ {
if (fragp->fr_opcode) if (fragp->fr_opcode)
fixp->fx_done = 1; fixp->fx_done = 1;
@ -6605,7 +6612,7 @@ s7_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
while (fixp && fixp->fx_frag == fragp) while (fixp && fixp->fx_frag == fragp)
{ {
if (fragp->fr_opcode) if (fragp->fr_opcode)
fixp->fx_where -= old + fragp->insn_addr; fixp->fx_where -= r_old + fragp->insn_addr;
else else
fixp->fx_done = 1; fixp->fx_done = 1;
fixp = fixp->fx_next; fixp = fixp->fx_next;

View File

@ -1350,7 +1350,7 @@ static char *
parse_exp (char *s, sh_operand_info *op) parse_exp (char *s, sh_operand_info *op)
{ {
char *save; char *save;
char *new; char *new_pointer;
save = input_line_pointer; save = input_line_pointer;
input_line_pointer = s; input_line_pointer = s;
@ -1363,9 +1363,9 @@ parse_exp (char *s, sh_operand_info *op)
|| sh_PIC_related_p (op->immediate.X_op_symbol)) || sh_PIC_related_p (op->immediate.X_op_symbol))
as_bad (_("misplaced PIC operand")); as_bad (_("misplaced PIC operand"));
#endif #endif
new = input_line_pointer; new_pointer = input_line_pointer;
input_line_pointer = save; input_line_pointer = save;
return new; return new_pointer;
} }
/* The many forms of operand: /* The many forms of operand:

View File

@ -2204,16 +2204,16 @@ static char *
shmedia_parse_exp (char *s, shmedia_operand_info *op) shmedia_parse_exp (char *s, shmedia_operand_info *op)
{ {
char *save; char *save;
char *new; char *new_pointer;
save = input_line_pointer; save = input_line_pointer;
input_line_pointer = s; input_line_pointer = s;
expression (&op->immediate); expression (&op->immediate);
if (op->immediate.X_op == O_absent) if (op->immediate.X_op == O_absent)
as_bad (_("missing operand")); as_bad (_("missing operand"));
new = input_line_pointer; new_pointer = input_line_pointer;
input_line_pointer = save; input_line_pointer = save;
return new; return new_pointer;
} }
/* Parse an operand. Store pointer to next character in *PTR. */ /* Parse an operand. Store pointer to next character in *PTR. */

View File

@ -117,7 +117,7 @@ md_begin (void)
op_hash = hash_new (); op_hash = hash_new ();
{ {
const template *current_optab = tic30_optab; const insn_template *current_optab = tic30_optab;
for (; current_optab < tic30_optab_end; current_optab++) for (; current_optab < tic30_optab_end; current_optab++)
{ {
@ -257,11 +257,11 @@ typedef struct
} immediate; } immediate;
} operand; } operand;
template *opcode; insn_template *opcode;
struct tic30_insn struct tic30_insn
{ {
template *tm; /* Template of current instruction. */ insn_template *tm; /* Template of current instruction. */
unsigned opcode; /* Final opcode. */ unsigned opcode; /* Final opcode. */
unsigned int operands; /* Number of given operands. */ unsigned int operands; /* Number of given operands. */
/* Type of operand given in instruction. */ /* Type of operand given in instruction. */
@ -1416,7 +1416,7 @@ md_operand (expressionS *expressionP ATTRIBUTE_UNUSED)
void void
md_assemble (char *line) md_assemble (char *line)
{ {
template *opcode; insn_template *opcode;
char *current_posn; char *current_posn;
char *token_start; char *token_start;
char save_char; char save_char;
@ -1464,7 +1464,7 @@ md_assemble (char *line)
/* Find instruction. */ /* Find instruction. */
save_char = *current_posn; save_char = *current_posn;
*current_posn = '\0'; *current_posn = '\0';
opcode = (template *) hash_find (op_hash, token_start); opcode = (insn_template *) hash_find (op_hash, token_start);
if (opcode) if (opcode)
{ {
debug ("Found instruction %s\n", opcode->name); debug ("Found instruction %s\n", opcode->name);

View File

@ -1516,7 +1516,7 @@ tic4x_operand_parse (char *s, tic4x_operand_t *operand)
expressionS *exp = &operand->expr; expressionS *exp = &operand->expr;
char *save = input_line_pointer; char *save = input_line_pointer;
char *str; char *str;
char *new; char *new_pointer;
struct hash_entry *entry = NULL; struct hash_entry *entry = NULL;
input_line_pointer = s; input_line_pointer = s;
@ -1524,7 +1524,7 @@ tic4x_operand_parse (char *s, tic4x_operand_t *operand)
str = input_line_pointer; str = input_line_pointer;
c = get_symbol_end (); /* Get terminator. */ c = get_symbol_end (); /* Get terminator. */
new = input_line_pointer; new_pointer = input_line_pointer;
if (strlen (str) && (entry = hash_find (tic4x_asg_hash, str)) != NULL) if (strlen (str) && (entry = hash_find (tic4x_asg_hash, str)) != NULL)
{ {
*input_line_pointer = c; *input_line_pointer = c;
@ -1666,9 +1666,9 @@ tic4x_operand_parse (char *s, tic4x_operand_t *operand)
#endif #endif
} }
if (entry == NULL) if (entry == NULL)
new = input_line_pointer; new_pointer = input_line_pointer;
input_line_pointer = save; input_line_pointer = save;
return new; return new_pointer;
} }
static int static int

View File

@ -81,7 +81,7 @@ static struct stag
typedef struct _tic54x_insn typedef struct _tic54x_insn
{ {
const template *tm; /* Opcode template. */ const insn_template *tm; /* Opcode template. */
char mnemonic[MAX_LINE]; /* Opcode name/mnemonic. */ char mnemonic[MAX_LINE]; /* Opcode name/mnemonic. */
char parmnemonic[MAX_LINE]; /* 2nd mnemonic of parallel insn. */ char parmnemonic[MAX_LINE]; /* 2nd mnemonic of parallel insn. */
@ -2989,7 +2989,7 @@ static const math_proc_entry math_procs[] =
void void
md_begin (void) md_begin (void)
{ {
template *tm; insn_template *tm;
symbol *sym; symbol *sym;
const subsym_proc_entry *subsym_proc; const subsym_proc_entry *subsym_proc;
const math_proc_entry *math_proc; const math_proc_entry *math_proc;
@ -3018,7 +3018,7 @@ md_begin (void)
} }
op_hash = hash_new (); op_hash = hash_new ();
for (tm = (template *) tic54x_optab; tm->name; tm++) for (tm = (insn_template *) tic54x_optab; tm->name; tm++)
{ {
if (hash_find (op_hash, tm->name)) if (hash_find (op_hash, tm->name))
continue; continue;
@ -3028,7 +3028,7 @@ md_begin (void)
tm->name, hash_err); tm->name, hash_err);
} }
parop_hash = hash_new (); parop_hash = hash_new ();
for (tm = (template *) tic54x_paroptab; tm->name; tm++) for (tm = (insn_template *) tic54x_paroptab; tm->name; tm++)
{ {
if (hash_find (parop_hash, tm->name)) if (hash_find (parop_hash, tm->name))
continue; continue;
@ -4179,7 +4179,7 @@ optimize_insn (tic54x_insn *insn)
static int static int
tic54x_parse_insn (tic54x_insn *insn, char *line) tic54x_parse_insn (tic54x_insn *insn, char *line)
{ {
insn->tm = (template *) hash_find (op_hash, insn->mnemonic); insn->tm = (insn_template *) hash_find (op_hash, insn->mnemonic);
if (!insn->tm) if (!insn->tm)
{ {
as_bad (_("Unrecognized instruction \"%s\""), insn->mnemonic); as_bad (_("Unrecognized instruction \"%s\""), insn->mnemonic);
@ -4202,8 +4202,8 @@ tic54x_parse_insn (tic54x_insn *insn, char *line)
/* SUCCESS! now try some optimizations. */ /* SUCCESS! now try some optimizations. */
if (optimize_insn (insn)) if (optimize_insn (insn))
{ {
insn->tm = (template *) hash_find (op_hash, insn->tm = (insn_template *) hash_find (op_hash,
insn->mnemonic); insn->mnemonic);
continue; continue;
} }
@ -4237,7 +4237,7 @@ next_line_shows_parallel (char *next_line)
static int static int
tic54x_parse_parallel_insn_firstline (tic54x_insn *insn, char *line) tic54x_parse_parallel_insn_firstline (tic54x_insn *insn, char *line)
{ {
insn->tm = (template *) hash_find (parop_hash, insn->mnemonic); insn->tm = (insn_template *) hash_find (parop_hash, insn->mnemonic);
if (!insn->tm) if (!insn->tm)
{ {
as_bad (_("Unrecognized parallel instruction \"%s\""), as_bad (_("Unrecognized parallel instruction \"%s\""),

View File

@ -342,15 +342,15 @@ static char *
parse_exp (char *s, expressionS *op) parse_exp (char *s, expressionS *op)
{ {
char *save = input_line_pointer; char *save = input_line_pointer;
char *new; char *new_pointer;
input_line_pointer = s; input_line_pointer = s;
expression (op); expression (op);
if (op->X_op == O_absent) if (op->X_op == O_absent)
as_bad (_("missing operand")); as_bad (_("missing operand"));
new = input_line_pointer; new_pointer = input_line_pointer;
input_line_pointer = save; input_line_pointer = save;
return new; return new_pointer;
} }
/* The many forms of operand: /* The many forms of operand:

View File

@ -285,7 +285,7 @@ listing_newline (char *ps)
unsigned int line; unsigned int line;
static unsigned int last_line = 0xffff; static unsigned int last_line = 0xffff;
static char *last_file = NULL; static char *last_file = NULL;
list_info_type *new = NULL; list_info_type *new_i = NULL;
if (listing == 0) if (listing == 0)
return; return;
@ -318,7 +318,7 @@ listing_newline (char *ps)
&& !(last_file && file && strcmp (file, last_file))) && !(last_file && file && strcmp (file, last_file)))
return; return;
new = (list_info_type *) xmalloc (sizeof (list_info_type)); new_i = (list_info_type *) xmalloc (sizeof (list_info_type));
/* Detect if we are reading from stdin by examining the file /* Detect if we are reading from stdin by examining the file
name returned by as_where(). name returned by as_where().
@ -371,15 +371,15 @@ listing_newline (char *ps)
*dest = 0; *dest = 0;
} }
new->line_contents = copy; new_i->line_contents = copy;
} }
else else
new->line_contents = NULL; new_i->line_contents = NULL;
} }
else else
{ {
new = xmalloc (sizeof (list_info_type)); new_i = (list_info_type *) xmalloc (sizeof (list_info_type));
new->line_contents = ps; new_i->line_contents = ps;
} }
last_line = line; last_line = line;
@ -388,21 +388,21 @@ listing_newline (char *ps)
new_frag (); new_frag ();
if (listing_tail) if (listing_tail)
listing_tail->next = new; listing_tail->next = new_i;
else else
head = new; head = new_i;
listing_tail = new; listing_tail = new_i;
new->frag = frag_now; new_i->frag = frag_now;
new->line = line; new_i->line = line;
new->file = file_info (file); new_i->file = file_info (file);
new->next = (list_info_type *) NULL; new_i->next = (list_info_type *) NULL;
new->message = (char *) NULL; new_i->message = (char *) NULL;
new->edict = EDICT_NONE; new_i->edict = EDICT_NONE;
new->hll_file = (file_info_type *) NULL; new_i->hll_file = (file_info_type *) NULL;
new->hll_line = 0; new_i->hll_line = 0;
new->debugging = 0; new_i->debugging = 0;
new_frag (); new_frag ();
@ -416,7 +416,7 @@ listing_newline (char *ps)
segname = segment_name (now_seg); segname = segment_name (now_seg);
if (strncmp (segname, ".debug", sizeof ".debug" - 1) == 0 if (strncmp (segname, ".debug", sizeof ".debug" - 1) == 0
|| strncmp (segname, ".line", sizeof ".line" - 1) == 0) || strncmp (segname, ".line", sizeof ".line" - 1) == 0)
new->debugging = 1; new_i->debugging = 1;
} }
#endif #endif
} }

View File

@ -1,3 +1,10 @@
2009-08-29 Martin Thuresson <martin@mtme.org>
* tic30.h (template): Rename type template to
insn_template. Updated code to use new name.
* tic54x.h (template): Rename type template to
insn_template.
2009-08-20 Nick Hudson <nick.hudson@gmx.co.uk> 2009-08-20 Nick Hudson <nick.hudson@gmx.co.uk>
* hppa.h (pa_opcodes): Add a pa10 bb without FLAG_STRICT. * hppa.h (pa_opcodes): Add a pa10 bb without FLAG_STRICT.

View File

@ -241,9 +241,9 @@ typedef struct _template
#define Imm_SInt 2 #define Imm_SInt 2
#define Imm_UInt 3 #define Imm_UInt 3
} }
template; insn_template;
static const template tic30_optab[] = { static const insn_template tic30_optab[] = {
{ "absf" ,2,0x00000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, { "absf" ,2,0x00000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
{ "absi" ,2,0x00800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, { "absi" ,2,0x00800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
{ "addc" ,2,0x01000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, { "addc" ,2,0x01000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
@ -604,7 +604,7 @@ static const template tic30_optab[] = {
{ "" ,0,0x00000000,0, { 0, 0, 0 }, 0 } { "" ,0,0x00000000,0, { 0, 0, 0 }, 0 }
}; };
static const template *const tic30_optab_end = static const insn_template *const tic30_optab_end =
tic30_optab + sizeof(tic30_optab)/sizeof(tic30_optab[0]); tic30_optab + sizeof(tic30_optab)/sizeof(tic30_optab[0]);
typedef struct { typedef struct {

View File

@ -147,17 +147,17 @@ typedef struct _template
const char* parname; const char* parname;
enum optype paroperand_types[MAX_OPERANDS]; enum optype paroperand_types[MAX_OPERANDS];
} template; } insn_template;
extern const template tic54x_unknown_opcode; extern const insn_template tic54x_unknown_opcode;
extern const template tic54x_optab[]; extern const insn_template tic54x_optab[];
extern const template tic54x_paroptab[]; extern const insn_template tic54x_paroptab[];
extern const symbol mmregs[], regs[]; extern const symbol mmregs[], regs[];
extern const symbol condition_codes[], cc2_codes[], status_bits[]; extern const symbol condition_codes[], cc2_codes[], status_bits[];
extern const symbol cc3_codes[]; extern const symbol cc3_codes[];
extern const char *misc_symbols[]; extern const char *misc_symbols[];
struct disassemble_info; struct disassemble_info;
extern const template* tic54x_get_insn (struct disassemble_info *, extern const insn_template* tic54x_get_insn (struct disassemble_info *,
bfd_vma, unsigned short, int *); bfd_vma, unsigned short, int *);
#endif /* _opcode_tic54x_h_ */ #endif /* _opcode_tic54x_h_ */

View File

@ -1,3 +1,19 @@
2009-08-29 Martin Thuresson <martin@mtme.org>
* ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop)
(exp_trinop, exp_unop, exp_nameop, exp_assop): Rename variable new
to new_e.
* ldfile.c (ldfile_add_library_path): Rename variable new to
new_dirs. (ldfile_add_arch): Rename variable new to new_arch.
* ldlang.c (new_statement, lang_final, lang_add_wild)
(lang_target, lang_add_fill, lang_add_data, lang_add_assignment)
(lang_add_insert): Rename variable new to new_stmt. (new_afile):
Added missing cast. (lang_memory_region_lookup): Rename variable
new to new_region. (init_os): Rename variable new to
new_userdata. (lang_add_section): Rename variable new to
new_section. (ldlang_add_undef): Rename variable new to
new_undef. (realsymbol): Rename variable new to new_name.
2009-08-26 Nick Clifton <nickc@redhat.com> 2009-08-26 Nick Clifton <nickc@redhat.com>
PR ld/10555 PR ld/10555

View File

@ -154,25 +154,25 @@ new_abs (bfd_vma value)
etree_type * etree_type *
exp_intop (bfd_vma value) exp_intop (bfd_vma value)
{ {
etree_type *new = stat_alloc (sizeof (new->value)); etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->value));
new->type.node_code = INT; new_e->type.node_code = INT;
new->type.lineno = lineno; new_e->type.lineno = lineno;
new->value.value = value; new_e->value.value = value;
new->value.str = NULL; new_e->value.str = NULL;
new->type.node_class = etree_value; new_e->type.node_class = etree_value;
return new; return new_e;
} }
etree_type * etree_type *
exp_bigintop (bfd_vma value, char *str) exp_bigintop (bfd_vma value, char *str)
{ {
etree_type *new = stat_alloc (sizeof (new->value)); etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->value));
new->type.node_code = INT; new_e->type.node_code = INT;
new->type.lineno = lineno; new_e->type.lineno = lineno;
new->value.value = value; new_e->value.value = value;
new->value.str = str; new_e->value.str = str;
new->type.node_class = etree_value; new_e->type.node_class = etree_value;
return new; return new_e;
} }
/* Build an expression representing an unnamed relocatable value. */ /* Build an expression representing an unnamed relocatable value. */
@ -180,13 +180,13 @@ exp_bigintop (bfd_vma value, char *str)
etree_type * etree_type *
exp_relop (asection *section, bfd_vma value) exp_relop (asection *section, bfd_vma value)
{ {
etree_type *new = stat_alloc (sizeof (new->rel)); etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->rel));
new->type.node_code = REL; new_e->type.node_code = REL;
new->type.lineno = lineno; new_e->type.lineno = lineno;
new->type.node_class = etree_rel; new_e->type.node_class = etree_rel;
new->rel.section = section; new_e->rel.section = section;
new->rel.value = value; new_e->rel.value = value;
return new; return new_e;
} }
static void static void
@ -851,7 +851,7 @@ exp_fold_tree_no_dot (etree_type *tree)
etree_type * etree_type *
exp_binop (int code, etree_type *lhs, etree_type *rhs) exp_binop (int code, etree_type *lhs, etree_type *rhs)
{ {
etree_type value, *new; etree_type value, *new_e;
value.type.node_code = code; value.type.node_code = code;
value.type.lineno = lhs->type.lineno; value.type.lineno = lhs->type.lineno;
@ -862,15 +862,15 @@ exp_binop (int code, etree_type *lhs, etree_type *rhs)
if (expld.result.valid_p) if (expld.result.valid_p)
return exp_intop (expld.result.value); return exp_intop (expld.result.value);
new = stat_alloc (sizeof (new->binary)); new_e = (etree_type *) stat_alloc (sizeof (new_e->binary));
memcpy (new, &value, sizeof (new->binary)); memcpy (new_e, &value, sizeof (new_e->binary));
return new; return new_e;
} }
etree_type * etree_type *
exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs) exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs)
{ {
etree_type value, *new; etree_type value, *new_e;
value.type.node_code = code; value.type.node_code = code;
value.type.lineno = lhs->type.lineno; value.type.lineno = lhs->type.lineno;
@ -882,15 +882,15 @@ exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs)
if (expld.result.valid_p) if (expld.result.valid_p)
return exp_intop (expld.result.value); return exp_intop (expld.result.value);
new = stat_alloc (sizeof (new->trinary)); new_e = (etree_type *) stat_alloc (sizeof (new_e->trinary));
memcpy (new, &value, sizeof (new->trinary)); memcpy (new_e, &value, sizeof (new_e->trinary));
return new; return new_e;
} }
etree_type * etree_type *
exp_unop (int code, etree_type *child) exp_unop (int code, etree_type *child)
{ {
etree_type value, *new; etree_type value, *new_e;
value.unary.type.node_code = code; value.unary.type.node_code = code;
value.unary.type.lineno = child->type.lineno; value.unary.type.lineno = child->type.lineno;
@ -900,15 +900,15 @@ exp_unop (int code, etree_type *child)
if (expld.result.valid_p) if (expld.result.valid_p)
return exp_intop (expld.result.value); return exp_intop (expld.result.value);
new = stat_alloc (sizeof (new->unary)); new_e = (etree_type *) stat_alloc (sizeof (new_e->unary));
memcpy (new, &value, sizeof (new->unary)); memcpy (new_e, &value, sizeof (new_e->unary));
return new; return new_e;
} }
etree_type * etree_type *
exp_nameop (int code, const char *name) exp_nameop (int code, const char *name)
{ {
etree_type value, *new; etree_type value, *new_e;
value.name.type.node_code = code; value.name.type.node_code = code;
value.name.type.lineno = lineno; value.name.type.lineno = lineno;
@ -919,24 +919,24 @@ exp_nameop (int code, const char *name)
if (expld.result.valid_p) if (expld.result.valid_p)
return exp_intop (expld.result.value); return exp_intop (expld.result.value);
new = stat_alloc (sizeof (new->name)); new_e = (etree_type *) stat_alloc (sizeof (new_e->name));
memcpy (new, &value, sizeof (new->name)); memcpy (new_e, &value, sizeof (new_e->name));
return new; return new_e;
} }
etree_type * etree_type *
exp_assop (int code, const char *dst, etree_type *src) exp_assop (int code, const char *dst, etree_type *src)
{ {
etree_type *new; etree_type *new_e;
new = stat_alloc (sizeof (new->assign)); new_e = (etree_type *) stat_alloc (sizeof (new_e->assign));
new->type.node_code = code; new_e->type.node_code = code;
new->type.lineno = src->type.lineno; new_e->type.lineno = src->type.lineno;
new->type.node_class = etree_assign; new_e->type.node_class = etree_assign;
new->assign.src = src; new_e->assign.src = src;
new->assign.dst = dst; new_e->assign.dst = dst;
return new; return new_e;
} }
/* Handle PROVIDE. */ /* Handle PROVIDE. */

View File

@ -98,28 +98,28 @@ is_sysrooted_pathname (const char *name, bfd_boolean notsame)
void void
ldfile_add_library_path (const char *name, bfd_boolean cmdline) ldfile_add_library_path (const char *name, bfd_boolean cmdline)
{ {
search_dirs_type *new; search_dirs_type *new_dirs;
if (!cmdline && config.only_cmd_line_lib_dirs) if (!cmdline && config.only_cmd_line_lib_dirs)
return; return;
new = xmalloc (sizeof (search_dirs_type)); new_dirs = (search_dirs_type *) xmalloc (sizeof (search_dirs_type));
new->next = NULL; new_dirs->next = NULL;
new->cmdline = cmdline; new_dirs->cmdline = cmdline;
*search_tail_ptr = new; *search_tail_ptr = new_dirs;
search_tail_ptr = &new->next; search_tail_ptr = &new_dirs->next;
/* If a directory is marked as honoring sysroot, prepend the sysroot path /* If a directory is marked as honoring sysroot, prepend the sysroot path
now. */ now. */
if (name[0] == '=') if (name[0] == '=')
{ {
new->name = concat (ld_sysroot, name + 1, (const char *) NULL); new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
new->sysrooted = TRUE; new_dirs->sysrooted = TRUE;
} }
else else
{ {
new->name = xstrdup (name); new_dirs->name = xstrdup (name);
new->sysrooted = is_sysrooted_pathname (name, FALSE); new_dirs->sysrooted = is_sysrooted_pathname (name, FALSE);
} }
} }
@ -615,19 +615,20 @@ void
ldfile_add_arch (const char *in_name) ldfile_add_arch (const char *in_name)
{ {
char *name = xstrdup (in_name); char *name = xstrdup (in_name);
search_arch_type *new = xmalloc (sizeof (search_arch_type)); search_arch_type *new_arch = (search_arch_type *)
xmalloc (sizeof (search_arch_type));
ldfile_output_machine_name = in_name; ldfile_output_machine_name = in_name;
new->name = name; new_arch->name = name;
new->next = NULL; new_arch->next = NULL;
while (*name) while (*name)
{ {
*name = TOLOWER (*name); *name = TOLOWER (*name);
name++; name++;
} }
*search_arch_tail_ptr = new; *search_arch_tail_ptr = new_arch;
search_arch_tail_ptr = &new->next; search_arch_tail_ptr = &new_arch->next;
} }

View File

@ -949,13 +949,13 @@ new_statement (enum statement_enum type,
size_t size, size_t size,
lang_statement_list_type *list) lang_statement_list_type *list)
{ {
lang_statement_union_type *new; lang_statement_union_type *new_stmt;
new = stat_alloc (size); new_stmt = (lang_statement_union_type *) stat_alloc (size);
new->header.type = type; new_stmt->header.type = type;
new->header.next = NULL; new_stmt->header.next = NULL;
lang_statement_append (list, new, &new->header.next); lang_statement_append (list, new_stmt, &new_stmt->header.next);
return new; return new_stmt;
} }
/* Build a new input file node for the language. There are several /* Build a new input file node for the language. There are several
@ -976,10 +976,11 @@ new_afile (const char *name,
lang_input_statement_type *p; lang_input_statement_type *p;
if (add_to_list) if (add_to_list)
p = new_stat (lang_input_statement, stat_ptr); p = (lang_input_statement_type *) new_stat (lang_input_statement, stat_ptr);
else else
{ {
p = stat_alloc (sizeof (lang_input_statement_type)); p = (lang_input_statement_type *)
stat_alloc (sizeof (lang_input_statement_type));
p->header.type = lang_input_statement_enum; p->header.type = lang_input_statement_enum;
p->header.next = NULL; p->header.next = NULL;
} }
@ -1220,7 +1221,7 @@ lang_memory_region_lookup (const char *const name, bfd_boolean create)
{ {
lang_memory_region_name *n; lang_memory_region_name *n;
lang_memory_region_type *r; lang_memory_region_type *r;
lang_memory_region_type *new; lang_memory_region_type *new_region;
/* NAME is NULL for LMA memspecs if no region was specified. */ /* NAME is NULL for LMA memspecs if no region was specified. */
if (name == NULL) if (name == NULL)
@ -1239,23 +1240,24 @@ lang_memory_region_lookup (const char *const name, bfd_boolean create)
if (!create && strcmp (name, DEFAULT_MEMORY_REGION)) if (!create && strcmp (name, DEFAULT_MEMORY_REGION))
einfo (_("%P:%S: warning: memory region `%s' not declared\n"), name); einfo (_("%P:%S: warning: memory region `%s' not declared\n"), name);
new = stat_alloc (sizeof (lang_memory_region_type)); new_region = (lang_memory_region_type *)
stat_alloc (sizeof (lang_memory_region_type));
new->name_list.name = xstrdup (name); new_region->name_list.name = xstrdup (name);
new->name_list.next = NULL; new_region->name_list.next = NULL;
new->next = NULL; new_region->next = NULL;
new->origin = 0; new_region->origin = 0;
new->length = ~(bfd_size_type) 0; new_region->length = ~(bfd_size_type) 0;
new->current = 0; new_region->current = 0;
new->last_os = NULL; new_region->last_os = NULL;
new->flags = 0; new_region->flags = 0;
new->not_flags = 0; new_region->not_flags = 0;
new->had_full_message = FALSE; new_region->had_full_message = FALSE;
*lang_memory_region_list_tail = new; *lang_memory_region_list_tail = new_region;
lang_memory_region_list_tail = &new->next; lang_memory_region_list_tail = &new_region->next;
return new; return new_region;
} }
void void
@ -2057,10 +2059,10 @@ init_os (lang_output_section_statement_type *s, asection *isec,
if (!link_info.reduce_memory_overheads) if (!link_info.reduce_memory_overheads)
{ {
fat_section_userdata_type *new fat_section_userdata_type *new_userdata = (fat_section_userdata_type *)
= stat_alloc (sizeof (fat_section_userdata_type)); stat_alloc (sizeof (fat_section_userdata_type));
memset (new, 0, sizeof (fat_section_userdata_type)); memset (new_userdata, 0, sizeof (fat_section_userdata_type));
get_userdata (s->bfd_section) = new; get_userdata (s->bfd_section) = new_userdata;
} }
/* If there is a base address, make sure that any sections it might /* If there is a base address, make sure that any sections it might
@ -2196,7 +2198,7 @@ lang_add_section (lang_statement_list_type *ptr,
if (section->output_section == NULL) if (section->output_section == NULL)
{ {
bfd_boolean first; bfd_boolean first;
lang_input_section_type *new; lang_input_section_type *new_section;
flagword flags; flagword flags;
flags = section->flags; flags = section->flags;
@ -2244,9 +2246,9 @@ lang_add_section (lang_statement_list_type *ptr,
} }
/* Add a section reference to the list. */ /* Add a section reference to the list. */
new = new_stat (lang_input_section, ptr); new_section = new_stat (lang_input_section, ptr);
new->section = section; new_section->section = section;
section->output_section = output->bfd_section; section->output_section = output->bfd_section;
/* If final link, don't copy the SEC_LINK_ONCE flags, they've /* If final link, don't copy the SEC_LINK_ONCE flags, they've
@ -3250,16 +3252,16 @@ typedef struct bfd_sym_chain ldlang_undef_chain_list_type;
void void
ldlang_add_undef (const char *const name) ldlang_add_undef (const char *const name)
{ {
ldlang_undef_chain_list_type *new = ldlang_undef_chain_list_type *new_undef = (ldlang_undef_chain_list_type *)
stat_alloc (sizeof (ldlang_undef_chain_list_type)); stat_alloc (sizeof (ldlang_undef_chain_list_type));
new->next = ldlang_undef_chain_list_head; new_undef->next = ldlang_undef_chain_list_head;
ldlang_undef_chain_list_head = new; ldlang_undef_chain_list_head = new_undef;
new->name = xstrdup (name); new_undef->name = xstrdup (name);
if (link_info.output_bfd != NULL) if (link_info.output_bfd != NULL)
insert_undefined (new->name); insert_undefined (new_undef->name);
} }
/* Insert NAME as undefined in the symbol table. */ /* Insert NAME as undefined in the symbol table. */
@ -6010,10 +6012,11 @@ lang_enter_output_section_statement (const char *output_section_statement_name,
void void
lang_final (void) lang_final (void)
{ {
lang_output_statement_type *new; lang_output_statement_type *new_stmt;
new_stmt = new_stat (lang_output_statement, stat_ptr);
new_stmt->name = output_filename;
new = new_stat (lang_output_statement, stat_ptr);
new->name = output_filename;
} }
/* Reset the current counters in the regions. */ /* Reset the current counters in the regions. */
@ -6377,7 +6380,7 @@ lang_add_wild (struct wildcard_spec *filespec,
bfd_boolean keep_sections) bfd_boolean keep_sections)
{ {
struct wildcard_list *curr, *next; struct wildcard_list *curr, *next;
lang_wild_statement_type *new; lang_wild_statement_type *new_stmt;
/* Reverse the list as the parser puts it back to front. */ /* Reverse the list as the parser puts it back to front. */
for (curr = section_list, section_list = NULL; for (curr = section_list, section_list = NULL;
@ -6399,18 +6402,18 @@ lang_add_wild (struct wildcard_spec *filespec,
lang_has_input_file = TRUE; lang_has_input_file = TRUE;
} }
new = new_stat (lang_wild_statement, stat_ptr); new_stmt = new_stat (lang_wild_statement, stat_ptr);
new->filename = NULL; new_stmt->filename = NULL;
new->filenames_sorted = FALSE; new_stmt->filenames_sorted = FALSE;
if (filespec != NULL) if (filespec != NULL)
{ {
new->filename = filespec->name; new_stmt->filename = filespec->name;
new->filenames_sorted = filespec->sorted == by_name; new_stmt->filenames_sorted = filespec->sorted == by_name;
} }
new->section_list = section_list; new_stmt->section_list = section_list;
new->keep_sections = keep_sections; new_stmt->keep_sections = keep_sections;
lang_list_init (&new->children); lang_list_init (&new_stmt->children);
analyze_walk_wild_section_handler (new); analyze_walk_wild_section_handler (new_stmt);
} }
void void
@ -6455,10 +6458,10 @@ lang_default_entry (const char *name)
void void
lang_add_target (const char *name) lang_add_target (const char *name)
{ {
lang_target_statement_type *new; lang_target_statement_type *new_stmt;
new = new_stat (lang_target_statement, stat_ptr); new_stmt = new_stat (lang_target_statement, stat_ptr);
new->target = name; new_stmt->target = name;
} }
void void
@ -6479,20 +6482,20 @@ lang_add_map (const char *name)
void void
lang_add_fill (fill_type *fill) lang_add_fill (fill_type *fill)
{ {
lang_fill_statement_type *new; lang_fill_statement_type *new_stmt;
new = new_stat (lang_fill_statement, stat_ptr); new_stmt = new_stat (lang_fill_statement, stat_ptr);
new->fill = fill; new_stmt->fill = fill;
} }
void void
lang_add_data (int type, union etree_union *exp) lang_add_data (int type, union etree_union *exp)
{ {
lang_data_statement_type *new; lang_data_statement_type *new_stmt;
new = new_stat (lang_data_statement, stat_ptr); new_stmt = new_stat (lang_data_statement, stat_ptr);
new->exp = exp; new_stmt->exp = exp;
new->type = type; new_stmt->type = type;
} }
/* Create a new reloc statement. RELOC is the BFD relocation type to /* Create a new reloc statement. RELOC is the BFD relocation type to
@ -6525,11 +6528,11 @@ lang_add_reloc (bfd_reloc_code_real_type reloc,
lang_assignment_statement_type * lang_assignment_statement_type *
lang_add_assignment (etree_type *exp) lang_add_assignment (etree_type *exp)
{ {
lang_assignment_statement_type *new; lang_assignment_statement_type *new_stmt;
new = new_stat (lang_assignment_statement, stat_ptr); new_stmt = new_stat (lang_assignment_statement, stat_ptr);
new->exp = exp; new_stmt->exp = exp;
return new; return new_stmt;
} }
void void
@ -6714,11 +6717,11 @@ lang_add_output_format (const char *format,
void void
lang_add_insert (const char *where, int is_before) lang_add_insert (const char *where, int is_before)
{ {
lang_insert_statement_type *new; lang_insert_statement_type *new_stmt;
new = new_stat (lang_insert_statement, stat_ptr); new_stmt = new_stat (lang_insert_statement, stat_ptr);
new->where = where; new_stmt->where = where;
new->is_before = is_before; new_stmt->is_before = is_before;
saved_script_handle = previous_script_handle; saved_script_handle = previous_script_handle;
} }
@ -7261,27 +7264,27 @@ realsymbol (const char *pattern)
} }
} }
/* This is called for each variable name or match expression. NEW is /* This is called for each variable name or match expression. NEW_NAME is
the name of the symbol to match, or, if LITERAL_P is FALSE, a glob the name of the symbol to match, or, if LITERAL_P is FALSE, a glob
pattern to be matched against symbol names. */ pattern to be matched against symbol names. */
struct bfd_elf_version_expr * struct bfd_elf_version_expr *
lang_new_vers_pattern (struct bfd_elf_version_expr *orig, lang_new_vers_pattern (struct bfd_elf_version_expr *orig,
const char *new, const char *new_name,
const char *lang, const char *lang,
bfd_boolean literal_p) bfd_boolean literal_p)
{ {
struct bfd_elf_version_expr *ret; struct bfd_elf_version_expr *ret;
ret = xmalloc (sizeof *ret); ret = (struct bfd_elf_version_expr *) xmalloc (sizeof *ret);
ret->next = orig; ret->next = orig;
ret->symver = 0; ret->symver = 0;
ret->script = 0; ret->script = 0;
ret->literal = TRUE; ret->literal = TRUE;
ret->pattern = literal_p ? new : realsymbol (new); ret->pattern = literal_p ? new_name : realsymbol (new_name);
if (ret->pattern == NULL) if (ret->pattern == NULL)
{ {
ret->pattern = new; ret->pattern = new_name;
ret->literal = FALSE; ret->literal = FALSE;
} }

View File

@ -1,3 +1,23 @@
2009-08-29 Martin Thuresson <martin@mtme.org>
* cris-dis.c (bytes_to_skip): Update code to use new name.
* i386-dis.c (putop): Update code to use new name.
* i386-gen.c (process_i386_opcodes): Update code to use
new name.
* i386-opc.h (struct template): Rename struct template to
insn_template. Update code accordingly.
* i386-tbl.h (i386_optab): Update type to use new name.
* ia64-dis.c (print_insn_ia64): Rename variable template
to template_val.
* tic30-dis.c (struct instruction, get_tic30_instruction):
Update code to use new name.
* tic54x-dis.c (has_lkaddr, get_insn_size)
(print_parallel_instruction, print_insn_tic54x, tic54x_get_insn):
Update code to use new name.
* tic54x-opc.c (tic54x_unknown_opcode, tic54x_optab):
Update type to new name.
* z8kgen.c (internal, gas): Rename variable new to new_op.
2009-08-28 H.J. Lu <hongjiu.lu@intel.com> 2009-08-28 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am (COMPILE_FOR_BUILD): Remove BUILD_CPPFLAGS. * Makefile.am (COMPILE_FOR_BUILD): Remove BUILD_CPPFLAGS.

View File

@ -660,17 +660,17 @@ bytes_to_skip (unsigned int insn,
{ {
/* Each insn is a word plus "immediate" operands. */ /* Each insn is a word plus "immediate" operands. */
unsigned to_skip = 2; unsigned to_skip = 2;
const char *template = matchedp->args; const char *template_name = (const char *) matchedp->args;
const char *s; const char *s;
for (s = template; *s; s++) for (s = template_name; *s; s++)
if ((*s == 's' || *s == 'N' || *s == 'Y') if ((*s == 's' || *s == 'N' || *s == 'Y')
&& (insn & 0x400) && (insn & 15) == 15 && (insn & 0x400) && (insn & 15) == 15
&& prefix_matchedp == NULL) && prefix_matchedp == NULL)
{ {
/* Immediate via [pc+], so we have to check the size of the /* Immediate via [pc+], so we have to check the size of the
operand. */ operand. */
int mode_size = 1 << ((insn >> 4) & (*template == 'z' ? 1 : 3)); int mode_size = 1 << ((insn >> 4) & (*template_name == 'z' ? 1 : 3));
if (matchedp->imm_oprnd_size == SIZE_FIX_32) if (matchedp->imm_oprnd_size == SIZE_FIX_32)
to_skip += 4; to_skip += 4;

View File

@ -10184,7 +10184,7 @@ OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
/* Capital letters in template are macros. */ /* Capital letters in template are macros. */
static int static int
putop (const char *template, int sizeflag) putop (const char *in_template, int sizeflag)
{ {
const char *p; const char *p;
int alt = 0; int alt = 0;
@ -10198,7 +10198,7 @@ putop (const char *template, int sizeflag)
else \ else \
abort (); abort ();
for (p = template; *p; p++) for (p = in_template; *p; p++)
{ {
switch (*p) switch (*p)
{ {

View File

@ -876,7 +876,7 @@ process_i386_opcodes (FILE *table)
xcalloc, free); xcalloc, free);
fprintf (table, "\n/* i386 opcode table. */\n\n"); fprintf (table, "\n/* i386 opcode table. */\n\n");
fprintf (table, "const template i386_optab[] =\n{\n"); fprintf (table, "const insn_template i386_optab[] =\n{\n");
/* Put everything on opcode array. */ /* Put everything on opcode array. */
while (!feof (fp)) while (!feof (fp))

View File

@ -524,7 +524,7 @@ typedef union i386_operand_type
unsigned int array[OTNumOfUints]; unsigned int array[OTNumOfUints];
} i386_operand_type; } i386_operand_type;
typedef struct template typedef struct insn_template
{ {
/* instruction name sans width suffix ("mov" for movl insns) */ /* instruction name sans width suffix ("mov" for movl insns) */
char *name; char *name;
@ -566,9 +566,9 @@ typedef struct template
either a register or an immediate operand. */ either a register or an immediate operand. */
i386_operand_type operand_types[MAX_OPERANDS]; i386_operand_type operand_types[MAX_OPERANDS];
} }
template; insn_template;
extern const template i386_optab[]; extern const insn_template i386_optab[];
/* these are for register name --> number & type hash lookup */ /* these are for register name --> number & type hash lookup */
typedef struct typedef struct

View File

@ -21,7 +21,7 @@
/* i386 opcode table. */ /* i386 opcode table. */
const template i386_optab[] = const insn_template i386_optab[] =
{ {
{ "mov", 2, 0xa0, None, 1, { "mov", 2, 0xa0, None, 1,
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

View File

@ -68,7 +68,7 @@ unit_to_type (ia64_insn opcode, enum ia64_unit unit)
int int
print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info) print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info)
{ {
ia64_insn t0, t1, slot[3], template, s_bit, insn; ia64_insn t0, t1, slot[3], template_val, s_bit, insn;
int slotnum, j, status, need_comma, retval, slot_multiplier; int slotnum, j, status, need_comma, retval, slot_multiplier;
const struct ia64_operand *odesc; const struct ia64_operand *odesc;
const struct ia64_opcode *idesc; const struct ia64_opcode *idesc;
@ -100,20 +100,20 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info)
t0 = bfd_getl64 (bundle); t0 = bfd_getl64 (bundle);
t1 = bfd_getl64 (bundle + 8); t1 = bfd_getl64 (bundle + 8);
s_bit = t0 & 1; s_bit = t0 & 1;
template = (t0 >> 1) & 0xf; template_val = (t0 >> 1) & 0xf;
slot[0] = (t0 >> 5) & 0x1ffffffffffLL; slot[0] = (t0 >> 5) & 0x1ffffffffffLL;
slot[1] = ((t0 >> 46) & 0x3ffff) | ((t1 & 0x7fffff) << 18); slot[1] = ((t0 >> 46) & 0x3ffff) | ((t1 & 0x7fffff) << 18);
slot[2] = (t1 >> 23) & 0x1ffffffffffLL; slot[2] = (t1 >> 23) & 0x1ffffffffffLL;
tname = ia64_templ_desc[template].name; tname = ia64_templ_desc[template_val].name;
if (slotnum == 0) if (slotnum == 0)
(*info->fprintf_func) (info->stream, "[%s] ", tname); (*info->fprintf_func) (info->stream, "[%s] ", tname);
else else
(*info->fprintf_func) (info->stream, " "); (*info->fprintf_func) (info->stream, " ");
unit = ia64_templ_desc[template].exec_unit[slotnum]; unit = ia64_templ_desc[template_val].exec_unit[slotnum];
if (template == 2 && slotnum == 1) if (template_val == 2 && slotnum == 1)
{ {
/* skip L slot in MLI template: */ /* skip L slot in MLI template: */
slotnum = 2; slotnum = 2;
@ -303,7 +303,7 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info)
need_comma = 0; need_comma = 0;
} }
} }
if (slotnum + 1 == ia64_templ_desc[template].group_boundary if (slotnum + 1 == ia64_templ_desc[template_val].group_boundary
|| ((slotnum == 2) && s_bit)) || ((slotnum == 2) && s_bit))
(*info->fprintf_func) (info->stream, ";;"); (*info->fprintf_func) (info->stream, ";;");

View File

@ -64,7 +64,7 @@ static unsigned int _pc;
struct instruction struct instruction
{ {
int type; int type;
template *tm; insn_template *tm;
partemplate *ptm; partemplate *ptm;
}; };
@ -78,7 +78,7 @@ get_tic30_instruction (unsigned long insn_word, struct instruction *insn)
case THREE_OPERAND: case THREE_OPERAND:
insn->type = NORMAL_INSN; insn->type = NORMAL_INSN;
{ {
template *current_optab = (template *) tic30_optab; insn_template *current_optab = (insn_template *) tic30_optab;
for (; current_optab < tic30_optab_end; current_optab++) for (; current_optab < tic30_optab_end; current_optab++)
{ {
@ -145,7 +145,7 @@ get_tic30_instruction (unsigned long insn_word, struct instruction *insn)
case BRANCHES: case BRANCHES:
insn->type = NORMAL_INSN; insn->type = NORMAL_INSN;
{ {
template *current_optab = (template *) tic30_optab; insn_template *current_optab = (insn_template *) tic30_optab;
for (; current_optab < tic30_optab_end; current_optab++) for (; current_optab < tic30_optab_end; current_optab++)
{ {

View File

@ -27,14 +27,14 @@
#include "opcode/tic54x.h" #include "opcode/tic54x.h"
#include "coff/tic54x.h" #include "coff/tic54x.h"
static int has_lkaddr (unsigned short, const template *); static int has_lkaddr (unsigned short, const insn_template *);
static int get_insn_size (unsigned short, const template *); static int get_insn_size (unsigned short, const insn_template *);
static int print_instruction (disassemble_info *, bfd_vma, static int print_instruction (disassemble_info *, bfd_vma,
unsigned short, const char *, unsigned short, const char *,
const enum optype [], int, int); const enum optype [], int, int);
static int print_parallel_instruction (disassemble_info *, bfd_vma, static int print_parallel_instruction (disassemble_info *, bfd_vma,
unsigned short, unsigned short,
const template *, int); const insn_template *, int);
static int sprint_dual_address (disassemble_info *,char [], static int sprint_dual_address (disassemble_info *,char [],
unsigned short); unsigned short);
static int sprint_indirect_address (disassemble_info *,char [], static int sprint_indirect_address (disassemble_info *,char [],
@ -51,7 +51,7 @@ print_insn_tic54x (bfd_vma memaddr, disassemble_info *info)
bfd_byte opbuf[2]; bfd_byte opbuf[2];
unsigned short opcode; unsigned short opcode;
int status, size; int status, size;
const template* tm; const insn_template* tm;
status = (*info->read_memory_func) (memaddr, opbuf, 2, info); status = (*info->read_memory_func) (memaddr, opbuf, 2, info);
if (status != 0) if (status != 0)
@ -86,7 +86,7 @@ print_insn_tic54x (bfd_vma memaddr, disassemble_info *info)
} }
static int static int
has_lkaddr (unsigned short memdata, const template *tm) has_lkaddr (unsigned short memdata, const insn_template *tm)
{ {
return (IS_LKADDR (memdata) return (IS_LKADDR (memdata)
&& (OPTYPE (tm->operand_types[0]) == OP_Smem && (OPTYPE (tm->operand_types[0]) == OP_Smem
@ -99,11 +99,11 @@ has_lkaddr (unsigned short memdata, const template *tm)
/* always returns 1 (whether an insn template was found) since we provide an /* always returns 1 (whether an insn template was found) since we provide an
"unknown instruction" template */ "unknown instruction" template */
const template* const insn_template*
tic54x_get_insn (disassemble_info *info, bfd_vma addr, tic54x_get_insn (disassemble_info *info, bfd_vma addr,
unsigned short memdata, int *size) unsigned short memdata, int *size)
{ {
const template *tm = NULL; const insn_template *tm = NULL;
for (tm = tic54x_optab; tm->name; tm++) for (tm = tic54x_optab; tm->name; tm++)
{ {
@ -135,7 +135,7 @@ tic54x_get_insn (disassemble_info *info, bfd_vma addr,
} }
} }
} }
for (tm = (template *) tic54x_paroptab; tm->name; tm++) for (tm = (insn_template *) tic54x_paroptab; tm->name; tm++)
{ {
if (tm->opcode == (memdata & tm->mask)) if (tm->opcode == (memdata & tm->mask))
{ {
@ -149,7 +149,7 @@ tic54x_get_insn (disassemble_info *info, bfd_vma addr,
} }
static int static int
get_insn_size (unsigned short memdata, const template *insn) get_insn_size (unsigned short memdata, const insn_template *insn)
{ {
int size; int size;
@ -472,7 +472,7 @@ print_parallel_instruction (info, memaddr, opcode, ptm, size)
disassemble_info *info; disassemble_info *info;
bfd_vma memaddr; bfd_vma memaddr;
unsigned short opcode; unsigned short opcode;
const template *ptm; const insn_template *ptm;
int size; int size;
{ {
print_instruction (info, memaddr, opcode, print_instruction (info, memaddr, opcode,

View File

@ -231,9 +231,9 @@ const char *misc_symbols[] = {
#define ZPAR 0,{OP_None} #define ZPAR 0,{OP_None}
#define REST 0,0,ZPAR #define REST 0,0,ZPAR
#define XREST ZPAR #define XREST ZPAR
const template tic54x_unknown_opcode = const insn_template tic54x_unknown_opcode =
{ "???", 1,0,0,0x0000, 0x0000, {0}, 0, REST}; { "???", 1,0,0,0x0000, 0x0000, {0}, 0, REST};
const template tic54x_optab[] = { const insn_template tic54x_optab[] = {
/* these must precede bc/bcd, cc/ccd to avoid misinterpretation */ /* these must precede bc/bcd, cc/ccd to avoid misinterpretation */
{ "fb", 2,1,1,0xF880, 0xFF80, {OP_xpmad}, B_BRANCH|FL_FAR|FL_NR, REST}, { "fb", 2,1,1,0xF880, 0xFF80, {OP_xpmad}, B_BRANCH|FL_FAR|FL_NR, REST},
{ "fbd", 2,1,1,0xFA80, 0xFF80, {OP_xpmad}, B_BRANCH|FL_FAR|FL_DELAY|FL_NR, REST}, { "fbd", 2,1,1,0xFA80, 0xFF80, {OP_xpmad}, B_BRANCH|FL_FAR|FL_DELAY|FL_NR, REST},
@ -465,7 +465,7 @@ const template tic54x_optab[] = {
}; };
/* assume all parallel instructions have at least three operands */ /* assume all parallel instructions have at least three operands */
const template tic54x_paroptab[] = { const insn_template tic54x_paroptab[] = {
{ "ld",1,1,2,0xA800, 0xFE00, {OP_Xmem,OP_DST}, FL_PAR,0,0, { "ld",1,1,2,0xA800, 0xFE00, {OP_Xmem,OP_DST}, FL_PAR,0,0,
"mac", {OP_Ymem,OPT|OP_RND},}, "mac", {OP_Ymem,OPT|OP_RND},},
{ "ld",1,1,2,0xAA00, 0xFE00, {OP_Xmem,OP_DST}, FL_PAR,0,0, { "ld",1,1,2,0xAA00, 0xFE00, {OP_Xmem,OP_DST}, FL_PAR,0,0,

View File

@ -904,14 +904,14 @@ static void
internal (void) internal (void)
{ {
int c = count (); int c = count ();
struct op *new = xmalloc (sizeof (struct op) * c); struct op *new_op = xmalloc (sizeof (struct op) * c);
struct op *p = opt; struct op *p = opt;
memcpy (new, p, c * sizeof (struct op)); memcpy (new_op, p, c * sizeof (struct op));
/* Sort all names in table alphabetically. */ /* Sort all names in table alphabetically. */
qsort (new, c, sizeof (struct op), (int (*)(const void *, const void *))func); qsort (new_op, c, sizeof (struct op), (int (*)(const void *, const void *))func);
p = new; p = new_op;
while (p->flags && p->flags[0] != '*') while (p->flags && p->flags[0] != '*')
{ {
/* If there are any @rs, sub the ssss into a ssn0, (rs), (ssn0). */ /* If there are any @rs, sub the ssss into a ssn0, (rs), (ssn0). */
@ -960,12 +960,12 @@ gas (void)
struct op *p = opt; struct op *p = opt;
int idx = -1; int idx = -1;
char *oldname = ""; char *oldname = "";
struct op *new = xmalloc (sizeof (struct op) * c); struct op *new_op = xmalloc (sizeof (struct op) * c);
memcpy (new, p, c * sizeof (struct op)); memcpy (new_op, p, c * sizeof (struct op));
/* Sort all names in table alphabetically. */ /* Sort all names in table alphabetically. */
qsort (new, c, sizeof (struct op), (int (*)(const void *, const void *)) func); qsort (new_op, c, sizeof (struct op), (int (*)(const void *, const void *)) func);
printf ("/* DO NOT EDIT! -*- buffer-read-only: t -*-\n"); printf ("/* DO NOT EDIT! -*- buffer-read-only: t -*-\n");
printf (" This file is automatically generated by z8kgen. */\n\n"); printf (" This file is automatically generated by z8kgen. */\n\n");
@ -1279,19 +1279,19 @@ gas (void)
printf ("#ifdef DEFINE_TABLE\n"); printf ("#ifdef DEFINE_TABLE\n");
printf ("const opcode_entry_type z8k_table[] = {\n"); printf ("const opcode_entry_type z8k_table[] = {\n");
while (new->flags && new->flags[0]) while (new_op->flags && new_op->flags[0])
{ {
int nargs; int nargs;
int length; int length;
printf ("\n/* %s *** %s */\n", new->bits, new->name); printf ("\n/* %s *** %s */\n", new_op->bits, new_op->name);
printf ("{\n"); printf ("{\n");
printf ("#ifdef NICENAMES\n"); printf ("#ifdef NICENAMES\n");
printf ("\"%s\",%d,%d,", new->name, new->type, new->cycles); printf ("\"%s\",%d,%d,", new_op->name, new_op->type, new_op->cycles);
{ {
int answer = 0; int answer = 0;
char *p = new->flags; char *p = new_op->flags;
while (*p) while (*p)
{ {
@ -1306,20 +1306,20 @@ gas (void)
printf ("#endif\n"); printf ("#endif\n");
nargs = chewname (&new->name); nargs = chewname (&new_op->name);
printf ("\n\t"); printf ("\n\t");
chewbits (new->bits, &length); chewbits (new_op->bits, &length);
length /= 2; length /= 2;
if (length & 1) if (length & 1)
abort(); abort();
if (strcmp (oldname, new->name) != 0) if (strcmp (oldname, new_op->name) != 0)
idx++; idx++;
printf (",%d,%d,%d", nargs, length, idx); printf (",%d,%d,%d", nargs, length, idx);
oldname = new->name; oldname = new_op->name;
printf ("},\n"); printf ("},\n");
new++; new_op++;
} }
printf ("\n/* end marker */\n"); printf ("\n/* end marker */\n");
printf ("{\n#ifdef NICENAMES\nNULL,0,0,\n0,\n#endif\n"); printf ("{\n#ifdef NICENAMES\nNULL,0,0,\n0,\n#endif\n");