diff options
author | Nick Clifton <nickc@redhat.com> | 2009-08-29 22:11:02 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2009-08-29 22:11:02 +0000 |
commit | d3ce72d070fa3a519388b0eca00d6cb45d337071 (patch) | |
tree | 104599ed64e14c9642bc50cde90b3ed942cf7653 /bfd | |
parent | 0aec8eb1b5dae3bf88546abd22dbdffc7888b747 (diff) | |
download | gdb-d3ce72d070fa3a519388b0eca00d6cb45d337071.zip gdb-d3ce72d070fa3a519388b0eca00d6cb45d337071.tar.gz gdb-d3ce72d070fa3a519388b0eca00d6cb45d337071.tar.bz2 |
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.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 45 | ||||
-rw-r--r-- | bfd/aoutx.h | 8 | ||||
-rw-r--r-- | bfd/coffgen.c | 36 | ||||
-rw-r--r-- | bfd/cpu-ia64-opc.c | 16 | ||||
-rw-r--r-- | bfd/doc/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/doc/chew.c | 30 | ||||
-rw-r--r-- | bfd/ecoff.c | 18 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 82 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 17 | ||||
-rw-r--r-- | bfd/elf32-m68k.c | 14 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 17 | ||||
-rw-r--r-- | bfd/elfxx-ia64.c | 28 | ||||
-rw-r--r-- | bfd/hash.c | 11 | ||||
-rw-r--r-- | bfd/ieee.c | 8 | ||||
-rw-r--r-- | bfd/linker.c | 16 | ||||
-rw-r--r-- | bfd/mach-o.c | 16 | ||||
-rw-r--r-- | bfd/oasys.c | 8 | ||||
-rw-r--r-- | bfd/pdp11.c | 8 | ||||
-rw-r--r-- | bfd/plugin.c | 10 | ||||
-rw-r--r-- | bfd/rs6000-core.c | 62 | ||||
-rw-r--r-- | bfd/som.c | 8 | ||||
-rw-r--r-- | bfd/syms.c | 8 | ||||
-rw-r--r-- | bfd/tekhex.c | 37 |
23 files changed, 300 insertions, 208 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ed8f2f2..20b91e8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -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> * acinclude.m4 (AM_INSTALL_LIBBFD): Call AM_SUBST_NOTMAKE for diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 480761d..c53ceac 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1668,12 +1668,12 @@ NAME (aout, make_empty_symbol) (bfd *abfd) { bfd_size_type amt = sizeof (aout_symbol_type); - aout_symbol_type *new = bfd_zalloc (abfd, amt); - if (!new) + aout_symbol_type *new_symbol = (aout_symbol_type *) bfd_zalloc (abfd, amt); + if (!new_symbol) 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. */ diff --git a/bfd/coffgen.c b/bfd/coffgen.c index a52f75a7..d7909cb 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -1794,17 +1794,17 @@ asymbol * coff_make_empty_symbol (bfd *abfd) { 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; - new->symbol.section = 0; - new->native = 0; - new->lineno = NULL; - new->done_lineno = FALSE; - new->symbol.the_bfd = abfd; + new_symbol->symbol.section = 0; + new_symbol->native = 0; + new_symbol->lineno = NULL; + new_symbol->done_lineno = FALSE; + new_symbol->symbol.the_bfd = abfd; - return & new->symbol; + return & new_symbol->symbol; } /* Make a debugging symbol. */ @@ -1815,23 +1815,23 @@ coff_bfd_make_debug_symbol (bfd *abfd, unsigned long sz ATTRIBUTE_UNUSED) { 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; /* @@ The 10 is a guess at a plausible maximum number of aux entries (but shouldn't be a constant). */ amt = sizeof (combined_entry_type) * 10; - new->native = bfd_zalloc (abfd, amt); - if (!new->native) + new_symbol->native = (combined_entry_type *) bfd_zalloc (abfd, amt); + if (!new_symbol->native) return NULL; - new->symbol.section = bfd_abs_section_ptr; - new->symbol.flags = BSF_DEBUGGING; - new->lineno = NULL; - new->done_lineno = FALSE; - new->symbol.the_bfd = abfd; + new_symbol->symbol.section = bfd_abs_section_ptr; + new_symbol->symbol.flags = BSF_DEBUGGING; + new_symbol->lineno = NULL; + new_symbol->done_lineno = FALSE; + new_symbol->symbol.the_bfd = abfd; - return & new->symbol; + return & new_symbol->symbol; } void diff --git a/bfd/cpu-ia64-opc.c b/bfd/cpu-ia64-opc.c index 10dc2aa..61ea0d6 100644 --- a/bfd/cpu-ia64-opc.c +++ b/bfd/cpu-ia64-opc.c @@ -81,19 +81,19 @@ ext_reg (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) static const char* ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) { - ia64_insn new = 0; + ia64_insn new_insn = 0; int i; for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) { - new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1)) - << self->field[i].shift); + new_insn |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1)) + << self->field[i].shift); value >>= self->field[i].bits; } if (value) return "integer operand out of range"; - *code |= new; + *code |= new_insn; return 0; } @@ -163,22 +163,22 @@ ins_imms_scaled (const struct ia64_operand *self, ia64_insn value, ia64_insn *code, int scale) { BFD_HOST_64_BIT svalue = value, sign_bit = 0; - ia64_insn new = 0; + ia64_insn new_insn = 0; int i; svalue >>= scale; for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) { - new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1)) - << self->field[i].shift); + new_insn |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1)) + << self->field[i].shift); sign_bit = (svalue >> (self->field[i].bits - 1)) & 1; svalue >>= self->field[i].bits; } if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1)) return "integer operand out of range"; - *code |= new; + *code |= new_insn; return 0; } diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index 87c9798..03eca56 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -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> * Makefile.in: Regenerate. diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c index 5622ff2..4dd46e5 100644 --- a/bfd/doc/chew.c +++ b/bfd/doc/chew.c @@ -1267,14 +1267,14 @@ dict_type * newentry (word) char *word; { - dict_type *new = (dict_type *) malloc (sizeof (dict_type)); - new->word = word; - new->next = root; - root = new; - new->code = (stinst_type *) malloc (sizeof (stinst_type)); - new->code_length = 1; - new->code_end = 0; - return new; + dict_type *new_d = (dict_type *) malloc (sizeof (dict_type)); + new_d->word = word; + new_d->next = root; + root = new_d; + new_d->code = (stinst_type *) malloc (sizeof (stinst_type)); + new_d->code_length = 1; + new_d->code_end = 0; + return new_d; } unsigned int @@ -1299,19 +1299,19 @@ add_intrinsic (name, func) char *name; void (*func) (); { - dict_type *new = newentry (name); - add_to_definition (new, func); - add_to_definition (new, 0); + dict_type *new_d = newentry (name); + add_to_definition (new_d, func); + add_to_definition (new_d, 0); } void add_var (name) char *name; { - dict_type *new = newentry (name); - add_to_definition (new, push_number); - add_to_definition (new, (stinst_type) (&(new->var))); - add_to_definition (new, 0); + dict_type *new_d = newentry (name); + add_to_definition (new_d, push_number); + add_to_definition (new_d, (stinst_type) (&(new_d->var))); + add_to_definition (new_d, 0); } void diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 9ff6a20..cb5d82f 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -644,18 +644,18 @@ static asymbol *ecoff_scom_symbol_ptr; asymbol * _bfd_ecoff_make_empty_symbol (bfd *abfd) { - ecoff_symbol_type *new; + ecoff_symbol_type *new_symbol; bfd_size_type amt = sizeof (ecoff_symbol_type); - new = bfd_zalloc (abfd, amt); - if (new == NULL) + new_symbol = (ecoff_symbol_type *) bfd_zalloc (abfd, amt); + if (new_symbol == NULL) return NULL; - new->symbol.section = NULL; - new->fdr = NULL; - new->local = FALSE; - new->native = NULL; - new->symbol.the_bfd = abfd; - return &new->symbol; + new_symbol->symbol.section = NULL; + new_symbol->fdr = NULL; + new_symbol->local = FALSE; + new_symbol->native = NULL; + new_symbol->symbol.the_bfd = abfd; + return &new_symbol->symbol; } /* Set the BFD flags and section for an ECOFF symbol. */ diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 5a0d9c3..2dbf23cf 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -2235,7 +2235,7 @@ enum elf32_arm_stub_type { typedef struct { - const insn_sequence* template; + const insn_sequence* template_sequence; int template_size; } stub_def; @@ -3443,7 +3443,7 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry, bfd_vma sym_value; int template_size; int size; - const insn_sequence *template; + const insn_sequence *template_sequence; int i; struct elf32_arm_link_hash_table * globals; 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_section->vma); - template = stub_entry->stub_template; + template_sequence = stub_entry->stub_template; template_size = stub_entry->stub_template_size; size = 0; for (i = 0; i < template_size; i++) { - switch (template[i].type) + switch (template_sequence[i].type) { case THUMB16_TYPE: { - bfd_vma data = template[i].data; - if (template[i].reloc_addend != 0) + bfd_vma data = (bfd_vma) template_sequence[i].data; + if (template_sequence[i].reloc_addend != 0) { /* We've borrowed the reloc_addend field to mean we should insert a condition code into this (Thumb-1 branch) @@ -3505,11 +3505,12 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry, break; 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); - put_thumb_insn (globals, stub_bfd, template[i].data & 0xffff, + put_thumb_insn (globals, stub_bfd, template_sequence[i].data & 0xffff, 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_offset[nrelocs++] = size; @@ -3518,10 +3519,11 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry, break; 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 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_offset[nrelocs++] = size; @@ -3530,7 +3532,7 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry, break; 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_offset[nrelocs++] = size; size += 4; @@ -3557,22 +3559,23 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry, BFD_ASSERT (nrelocs != 0 && nrelocs <= MAXRELOCS); for (i = 0; i < nrelocs; i++) - if (template[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP24 - || template[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP19 - || template[stub_reloc_idx[i]].r_type == R_ARM_THM_CALL - || template[stub_reloc_idx[i]].r_type == R_ARM_THM_XPC22) + if (template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP24 + || template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP19 + || template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_CALL + || template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_XPC22) { Elf_Internal_Rela rel; bfd_boolean unresolved_reloc; char *error_message; 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; bfd_vma points_to = sym_value + stub_entry->target_addend; 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_addend = template[stub_reloc_idx[i]].reloc_addend; + rel.r_info = ELF32_R_INFO (0, + 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) /* 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 conditional, for the sake of consistency. */ 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, points_to, info, stub_entry->target_section, "", sym_flags, (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 { _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], sym_value + stub_entry->target_addend, - template[stub_reloc_idx[i]].reloc_addend); + template_sequence[stub_reloc_idx[i]].reloc_addend); } return TRUE; @@ -3615,17 +3618,17 @@ find_stub_size_and_template (enum elf32_arm_stub_type stub_type, const insn_sequence **stub_template, int *stub_template_size) { - const insn_sequence *template = NULL; + const insn_sequence *template_sequence = NULL; int template_size = 0, i; 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; size = 0; for (i = 0; i < template_size; i++) { - switch (template[i].type) + switch (template_sequence[i].type) { case THUMB16_TYPE: size += 2; @@ -3644,7 +3647,7 @@ find_stub_size_and_template (enum elf32_arm_stub_type stub_type, } if (stub_template) - *stub_template = template; + *stub_template = template_sequence; if (stub_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_link_hash_table *htab; - const insn_sequence *template; + const insn_sequence *template_sequence; int template_size, size; /* 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) && 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); stub_entry->stub_size = size; - stub_entry->stub_template = template; + stub_entry->stub_template = template_sequence; stub_entry->stub_template_size = template_size; size = (size + 7) & ~7; @@ -4679,7 +4682,7 @@ elf32_arm_size_stubs (bfd *output_bfd, unsigned int section_id = a8_fixes[i].section->id; asection *link_sec = htab->stub_group[section_id].link_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; 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->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); stub_entry->stub_size = size; - stub_entry->stub_template = template; + stub_entry->stub_template = template_sequence; stub_entry->stub_template_size = template_size; } @@ -12976,7 +12980,7 @@ arm_map_one_stub (struct bfd_hash_entry * gen_entry, bfd_vma addr; char *stub_name; output_arch_syminfo *osi; - const insn_sequence *template; + const insn_sequence *template_sequence; enum stub_insn_type prev_type; int size; int i; @@ -12999,8 +13003,8 @@ arm_map_one_stub (struct bfd_hash_entry * gen_entry, addr = (bfd_vma) stub_entry->stub_offset; stub_name = stub_entry->output_name; - template = stub_entry->stub_template; - switch (template[0].type) + template_sequence = stub_entry->stub_template; + switch (template_sequence[0].type) { case ARM_TYPE: 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; for (i = 0; i < stub_entry->stub_template_size; i++) { - switch (template[i].type) + switch (template_sequence[i].type) { case ARM_TYPE: sym_type = ARM_MAP_ARM; @@ -13041,14 +13045,14 @@ arm_map_one_stub (struct bfd_hash_entry * gen_entry, 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)) return FALSE; } - switch (template[i].type) + switch (template_sequence[i].type) { case ARM_TYPE: case THUMB32_TYPE: diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index c8e018a..462e0e8 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -4045,6 +4045,23 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd, { 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); if (h->plt.offset != (bfd_vma) -1) diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 1eeb978..f85aba0 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -1531,7 +1531,7 @@ elf_m68k_get_got_entry (struct elf_m68k_got *got, static enum elf_m68k_reloc_type elf_m68k_update_got_entry_type (struct elf_m68k_got *got, 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 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]. */ was_size = R_LAST; - was = new; + was = new_reloc; } else { /* !!! We, probably, should emit an error rather then fail on assert in such a case. */ 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); } - new_size = elf_m68k_reloc_got_offset_size (new); - n_slots = elf_m68k_reloc_got_n_slots (new); + new_size = elf_m68k_reloc_got_offset_size (new_reloc); + n_slots = elf_m68k_reloc_got_n_slots (new_reloc); 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; } - if (new > was) + if (new_reloc > was) /* Relocations are ordered from bigger got offset size to lesser, so choose the relocation type with lesser offset size. */ - was = new; + was = new_reloc; return was; } diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index de6f6ec..6db6472 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -3716,6 +3716,23 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd, { 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); if (h->plt.offset != (bfd_vma) -1) diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index ccb849d..b43eb12 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -612,7 +612,7 @@ bfd_elfNN_ia64_after_parse (int itanium) static bfd_boolean 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; long br_slot; 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 of the bundle. Even if there are predicates on NOPs, we still perform this optimization. */ - template = t0 & 0x1e; + template_val = t0 & 0x1e; s0 = (t0 >> 5) & 0x1ffffffffffLL; s1 = ((t0 >> 46) | (t1 << 18)) & 0x1ffffffffffLL; s2 = (t1 >> 23) & 0x1ffffffffffLL; @@ -642,9 +642,9 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off) case 1: /* Check if slot 2 is NOP. Possible templates are MBB and BBB. For BBB, slot 0 also has to be nop.b. */ - if (!((template == 0x12 /* MBB */ + if (!((template_val == 0x12 /* MBB */ && IS_NOP_B (s2)) - || (template == 0x16 /* BBB */ + || (template_val == 0x16 /* BBB */ && IS_NOP_B (s0) && IS_NOP_B (s2)))) return FALSE; @@ -653,16 +653,16 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off) case 2: /* 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. */ - if (!((template == 0x10 /* MIB */ + if (!((template_val == 0x10 /* MIB */ && IS_NOP_I (s1)) - || (template == 0x12 /* MBB */ + || (template_val == 0x12 /* MBB */ && IS_NOP_B (s1)) - || (template == 0x16 /* BBB */ + || (template_val == 0x16 /* BBB */ && IS_NOP_B (s0) && IS_NOP_B (s1)) - || (template == 0x18 /* MMB */ + || (template_val == 0x18 /* MMB */ && IS_NOP_M (s1)) - || (template == 0x1c /* MFB */ + || (template_val == 0x1c /* MFB */ && IS_NOP_F (s1)))) return FALSE; br_code = s2; @@ -686,7 +686,7 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off) else mlx = 0x4; - if (template == 0x16) + if (template_val == 0x16) { /* For BBB, we need to put nop.m in slot 0. We keep the original predicate only if slot 0 isn't br. */ @@ -715,7 +715,7 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off) static void elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off) { - int template; + int template_val; bfd_byte *hit_addr; 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 variety. */ if (t0 & 0x1) - template = 0x13; + template_val = 0x13; else - template = 0x12; - t0 = (i1 << 46) | (i0 << 5) | template; + template_val = 0x12; + t0 = (i1 << 46) | (i0 << 5) | template_val; t1 = (i2 << 23) | (i1 >> 18); bfd_putl64 (t0, hit_addr); @@ -453,16 +453,17 @@ bfd_hash_lookup (struct bfd_hash_table *table, if (copy) { - char *new; + char *new_string; - new = objalloc_alloc ((struct objalloc *) table->memory, len + 1); - if (!new) + new_string = (char *) objalloc_alloc ((struct objalloc *) table->memory, + len + 1); + if (!new_string) { bfd_set_error (bfd_error_no_memory); return NULL; } - memcpy (new, string, len + 1); - string = new; + memcpy (new_string, string, len + 1); + string = new_string; } return bfd_hash_insert (table, string, hash); @@ -3627,12 +3627,12 @@ static asymbol * ieee_make_empty_symbol (bfd *abfd) { 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; - new->symbol.the_bfd = abfd; - return &new->symbol; + new_symbol->symbol.the_bfd = abfd; + return &new_symbol->symbol; } static bfd * diff --git a/bfd/linker.c b/bfd/linker.c index 825a4e0..2924886 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -2604,21 +2604,21 @@ struct bfd_link_order * bfd_new_link_order (bfd *abfd, asection *section) { 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); - if (!new) + new_lo = (struct bfd_link_order *) bfd_zalloc (abfd, amt); + if (!new_lo) return NULL; - new->type = bfd_undefined_link_order; + new_lo->type = bfd_undefined_link_order; if (section->map_tail.link_order != NULL) - section->map_tail.link_order->next = new; + section->map_tail.link_order->next = new_lo; else - section->map_head.link_order = new; - section->map_tail.link_order = new; + section->map_head.link_order = new_lo; + section->map_tail.link_order = new_lo; - return new; + return new_lo; } /* Default link order processing routine. Note that we can not handle diff --git a/bfd/mach-o.c b/bfd/mach-o.c index ac1d6b8..d1d6e70 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -1255,14 +1255,14 @@ bfd_mach_o_sizeof_headers (bfd *a ATTRIBUTE_UNUSED, asymbol * bfd_mach_o_make_empty_symbol (bfd *abfd) { - asymbol *new; - - new = bfd_zalloc (abfd, sizeof (bfd_mach_o_asymbol)); - if (new == NULL) - return new; - new->the_bfd = abfd; - new->udata.i = 0; - return new; + asymbol *new_symbol; + + new_symbol = bfd_zalloc (abfd, sizeof (bfd_mach_o_asymbol)); + if (new_symbol == NULL) + return new_symbol; + new_symbol->the_bfd = abfd; + new_symbol->udata.i = 0; + return new_symbol; } static bfd_boolean diff --git a/bfd/oasys.c b/bfd/oasys.c index c83d3ea..37b6a2f 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -1084,12 +1084,12 @@ static asymbol * oasys_make_empty_symbol (bfd *abfd) { 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; - new->symbol.the_bfd = abfd; - return &new->symbol; + new_symbol_type->symbol.the_bfd = abfd; + return &new_symbol_type->symbol; } /* User should have checked the file flags; perhaps we should return diff --git a/bfd/pdp11.c b/bfd/pdp11.c index faf7a68..620d218 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -1433,13 +1433,13 @@ asymbol * NAME (aout, make_empty_symbol) (bfd *abfd) { 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; - 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. */ diff --git a/bfd/plugin.c b/bfd/plugin.c index 053fdd1..a81db6f 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -415,11 +415,11 @@ bfd_plugin_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED, static asymbol * bfd_plugin_make_empty_symbol (bfd *abfd) { - asymbol *new = bfd_zalloc (abfd, sizeof (asymbol)); - if (new == NULL) - return new; - new->the_bfd = abfd; - return new; + asymbol *new_symbol = bfd_zalloc (abfd, sizeof (asymbol)); + if (new_symbol == NULL) + return new_symbol; + new_symbol->the_bfd = abfd; + return new_symbol; } static int diff --git a/bfd/rs6000-core.c b/bfd/rs6000-core.c index ad7bef9..7a88b16 100644 --- a/bfd/rs6000-core.c +++ b/bfd/rs6000-core.c @@ -107,9 +107,9 @@ typedef union { typedef union { #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 - struct core_dump new; /* for simpler coding */ + struct core_dump new_dump; /* for simpler coding */ #endif struct core_dump old; /* old AIX 4.2- core dump, still used on 4.3+ with appropriate SMIT config */ @@ -120,9 +120,9 @@ typedef union { #ifdef CORE_VERSION_1 typedef union { #ifdef AIX_CORE_DUMPX_CORE - struct vm_infox new; + struct vm_infox new_dump; #else - struct vm_info new; + struct vm_info new_dump; #endif struct vm_info old; } VmInfo; @@ -144,7 +144,7 @@ typedef union { #ifdef AIX_5_CORE # 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 # define CNEW_IS_CORE_DUMPXX(c) 0 #endif @@ -291,7 +291,7 @@ read_hdr (bfd *abfd, CoreHdr *core) /* Read the trailing portion of the structure. */ if (CORE_NEW (*core)) - size = sizeof (core->new); + size = sizeof (core->new_core); else size = sizeof (core->old); size -= CORE_COMMONSZ; @@ -352,13 +352,13 @@ rs6000coff_core_p (bfd *abfd) /* Copy fields from new or old core structure. */ if (CORE_NEW (core)) { - c_flag = core.new.c_flag; - c_stack = (file_ptr) core.new.c_stack; - c_size = core.new.c_size; - c_stackend = CNEW_STACKORG (core.new) + c_size; - c_lsize = CNEW_LSIZE (core.new); - c_loader = CNEW_LOADER (core.new); - proc64 = CNEW_PROC64 (core.new); + c_flag = core.new_dump.c_flag; + c_stack = (file_ptr) core.new_dump.c_stack; + c_size = core.new_dump.c_size; + c_stackend = CNEW_STACKORG (core.new_dump) + c_size; + c_lsize = CNEW_LSIZE (core.new_dump); + c_loader = CNEW_LOADER (core.new_dump); + proc64 = CNEW_PROC64 (core.new_dump); } else { @@ -373,13 +373,13 @@ rs6000coff_core_p (bfd *abfd) if (proc64) { - c_regsize = sizeof (CNEW_CONTEXT64 (core.new)); - c_regptr = &CNEW_CONTEXT64 (core.new); + c_regsize = sizeof (CNEW_CONTEXT64 (core.new_dump)); + c_regptr = &CNEW_CONTEXT64 (core.new_dump); } else if (CORE_NEW (core)) { - c_regsize = sizeof (CNEW_MSTSAVE (core.new)); - c_regptr = &CNEW_MSTSAVE (core.new); + c_regsize = sizeof (CNEW_MSTSAVE (core.new_dump)); + c_regptr = &CNEW_MSTSAVE (core.new_dump); } else { @@ -449,7 +449,7 @@ rs6000coff_core_p (bfd *abfd) bfd_get_filename (abfd)); /* 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); if (!tmpptr) return NULL; @@ -464,7 +464,7 @@ rs6000coff_core_p (bfd *abfd) enum bfd_architecture arch; unsigned long mach; - switch (CNEW_IMPL (core.new)) + switch (CNEW_IMPL (core.new_dump)) { case POWER_RS1: case POWER_RSC: @@ -537,10 +537,10 @@ rs6000coff_core_p (bfd *abfd) if (CORE_NEW (core)) { - c_datasize = CNEW_DATASIZE (core.new); - c_data = (file_ptr) core.new.c_data; - c_vmregions = core.new.c_vmregions; - c_vmm = (file_ptr) core.new.c_vmm; + c_datasize = CNEW_DATASIZE (core.new_dump); + c_data = (file_ptr) core.new_dump.c_data; + c_vmregions = core.new_dump.c_vmregions; + c_vmm = (file_ptr) core.new_dump.c_vmm; } else { @@ -615,15 +615,15 @@ rs6000coff_core_p (bfd *abfd) file_ptr vminfo_offset; 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) goto fail; if (CORE_NEW (core)) { - vminfo_addr = (bfd_vma) vminfo.new.vminfo_addr; - vminfo_size = vminfo.new.vminfo_size; - vminfo_offset = vminfo.new.vminfo_offset; + vminfo_addr = (bfd_vma) vminfo.new_dump.vminfo_addr; + vminfo_size = vminfo.new_dump.vminfo_size; + vminfo_offset = vminfo.new_dump.vminfo_offset; } else { @@ -669,11 +669,11 @@ rs6000coff_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd) return FALSE; if (CORE_NEW (core)) - c_loader = CNEW_LOADER (core.new); + c_loader = CNEW_LOADER (core.new_dump); else 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; else size = (int) ((LdInfo *) 0)->l32.ldinfo_filename; @@ -735,7 +735,7 @@ rs6000coff_core_file_failing_command (bfd *abfd) { CoreHdr *core = core_hdr (abfd); char *com = CORE_NEW (*core) ? - CNEW_COMM (core->new) : COLD_COMM (core->old); + CNEW_COMM (core->new_dump) : COLD_COMM (core->old); if (*com) return com; @@ -747,7 +747,7 @@ int rs6000coff_core_file_failing_signal (bfd *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 */ @@ -4472,13 +4472,13 @@ static asymbol * som_make_empty_symbol (bfd *abfd) { 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; - new->symbol.the_bfd = abfd; + new_symbol_type->symbol.the_bfd = abfd; - return &new->symbol; + return &new_symbol_type->symbol; } /* Print symbol information. */ @@ -539,10 +539,10 @@ asymbol * _bfd_generic_make_empty_symbol (bfd *abfd) { bfd_size_type amt = sizeof (asymbol); - asymbol *new = bfd_zalloc (abfd, amt); - if (new) - new->the_bfd = abfd; - return new; + asymbol *new_symbol = (asymbol *) bfd_zalloc (abfd, amt); + if (new_symbol) + new_symbol->the_bfd = abfd; + return new_symbol; } /* diff --git a/bfd/tekhex.c b/bfd/tekhex.c index 01853da..49bac82 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -415,31 +415,33 @@ first_phase (bfd *abfd, int type, char *src) /* Symbols, add to section. */ { 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); - if (!new) + if (!new_symbol) return FALSE; - new->symbol.the_bfd = abfd; + new_symbol->symbol.the_bfd = abfd; src++; abfd->symcount++; abfd->flags |= HAS_SYMS; - new->prev = abfd->tdata.tekhex_data->symbols; - abfd->tdata.tekhex_data->symbols = new; + new_symbol->prev = abfd->tdata.tekhex_data->symbols; + abfd->tdata.tekhex_data->symbols = new_symbol; if (!getsym (sym, &src, &len)) return FALSE; - new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1); - if (!new->symbol.name) + new_symbol->symbol.name = (const char *) + bfd_alloc (abfd, (bfd_size_type) len + 1); + if (!new_symbol->symbol.name) return FALSE; - memcpy ((char *) (new->symbol.name), sym, len + 1); - new->symbol.section = section; + memcpy ((char *) (new_symbol->symbol.name), sym, len + 1); + new_symbol->symbol.section = section; if (stype <= '4') - new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT); + new_symbol->symbol.flags = (BSF_GLOBAL | BSF_EXPORT); else - new->symbol.flags = BSF_LOCAL; + new_symbol->symbol.flags = BSF_LOCAL; if (!getvalue (&src, &val)) return FALSE; - new->symbol.value = val - section->vma; + new_symbol->symbol.value = val - section->vma; break; } default: @@ -880,13 +882,14 @@ static asymbol * tekhex_make_empty_symbol (bfd *abfd) { 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; - new->symbol.the_bfd = abfd; - new->prev = NULL; - return &(new->symbol); + new_symbol->symbol.the_bfd = abfd; + new_symbol->prev = NULL; + return &(new_symbol->symbol); } static void |