diff options
author | Nick Clifton <nickc@redhat.com> | 2009-09-25 19:13:27 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2009-09-25 19:13:27 +0000 |
commit | 21d799b5c48956e71980143cb33035262984ed67 (patch) | |
tree | dbc66291451a9c7a4eb814c731c2bb247bba23b5 /gas/config/tc-alpha.c | |
parent | fa9efd0fbc3f388e06f8f893c168e8e612216230 (diff) | |
download | gdb-21d799b5c48956e71980143cb33035262984ed67.zip gdb-21d799b5c48956e71980143cb33035262984ed67.tar.gz gdb-21d799b5c48956e71980143cb33035262984ed67.tar.bz2 |
Update soruces to make alpha, arc and arm targets compile cleanly
with -Wc++-compat:
* config/tc-alpha.c: Add casts.
(extended_bfd_reloc_code_real_type): New type. Used to avoid
enumeration conversion warnings.
(struct alpha_fixup, void assemble_insn, assemble_insn)
(assemble_tokens): Use new type.
* ecoff.c: Add casts. (mark_stabs): Use enumeration names.
* config/obj-elf.c: Add cast
* config/tc-arc.c: Add casts.
* config/obj-aout.h (text_section,data_section,bss_section):
Make extern.
* config/obj-elf.c: Add cast.
* config/tc-arm.c: Add casts.
(X, TxCE, TxCE, TxC3, TxC3w, TxCM_, TxCM, TUE, TUF, CE, CL, cCE)
(cCL, C3E, xCM_, nUF, nCE_tag): Change input format to avoid the
need for keywords as arguments.
* ecoff.c: Add casts.
* ecofflink.c: Add casts.
* elf64-alpha.c: Add casts.
(struct alpha_elf_got_entry, struct alpha_elf_reloc_entry): Move
to top level.
(SKIP_HOWTO): Use enum name.
* elf32-arm.c: Add casts.
(elf32_arm_vxworks_bed): Update code to avoid multiple
declarations.
(struct map_stub): Move to top level.
* arc-dis.c Fix casts.
* arc-ext.c: Add casts.
* arm-dis.c (enum opcode_sentinel_enum): Gave name to anonymous
enum.
* emultempl/armelf.em: Add casts.
Diffstat (limited to 'gas/config/tc-alpha.c')
-rw-r--r-- | gas/config/tc-alpha.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 35d3812..45144af 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -75,10 +75,15 @@ #define MAX_INSN_FIXUPS 2 #define MAX_INSN_ARGS 5 +/* Used since new relocation types are introduced in this + file (DUMMY_RELOC_LITUSE_*) */ +typedef int extended_bfd_reloc_code_real_type; + struct alpha_fixup { expressionS exp; - bfd_reloc_code_real_type reloc; + /* bfd_reloc_code_real_type reloc; */ + extended_bfd_reloc_code_real_type reloc; #ifdef OBJ_EVAX symbolS *xtrasym, *procsym; #endif @@ -444,7 +449,7 @@ static const struct alpha_reloc_op_tag const char *name; /* String to lookup. */ size_t length; /* Size of the string. */ operatorT op; /* Which operator to use. */ - bfd_reloc_code_real_type reloc; /* Relocation before frob. */ + extended_bfd_reloc_code_real_type reloc; unsigned int require_seq : 1; /* Require a sequence number. */ unsigned int allow_seq : 1; /* Allow a sequence number. */ } @@ -565,7 +570,7 @@ static const char * const mskXh_op[] = { NULL, "mskwh", "msklh", "mskqh" }; static const char * const stX_op[] = { "stb", "stw", "stl", "stq" }; static const char * const ldXu_op[] = { "ldbu", "ldwu", NULL, NULL }; -static void assemble_insn (const struct alpha_opcode *, const expressionS *, int, struct alpha_insn *, bfd_reloc_code_real_type); +static void assemble_insn (const struct alpha_opcode *, const expressionS *, int, struct alpha_insn *, extended_bfd_reloc_code_real_type); static void emit_insn (struct alpha_insn *); static void assemble_tokens (const char *, const expressionS *, int, int); #ifdef OBJ_EVAX @@ -587,7 +592,8 @@ get_alpha_reloc_tag (long sequence) size_t len = strlen (buffer); const char *errmsg; - info = xcalloc (sizeof (struct alpha_reloc_tag) + len, 1); + info = (struct alpha_reloc_tag *) + xcalloc (sizeof (struct alpha_reloc_tag) + len, 1); info->segment = now_seg; info->sequence = sequence; @@ -1764,8 +1770,9 @@ emit_insn (struct alpha_insn *insn) } else { - reloc_howto_type *reloc_howto - = bfd_reloc_type_lookup (stdoutput, fixup->reloc); + reloc_howto_type *reloc_howto = + bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) fixup->reloc); gas_assert (reloc_howto); size = bfd_get_reloc_size (reloc_howto); @@ -1787,7 +1794,7 @@ emit_insn (struct alpha_insn *insn) } fixP = fix_new_exp (frag_now, f - frag_now->fr_literal, size, - &fixup->exp, pcrel, fixup->reloc); + &fixup->exp, pcrel, (bfd_reloc_code_real_type) fixup->reloc); /* Turn off complaints that the addend is too large for some fixups, and copy in the sequence number for the explicit relocations. */ @@ -2002,7 +2009,7 @@ assemble_insn (const struct alpha_opcode *opcode, const expressionS *tok, int ntok, struct alpha_insn *insn, - bfd_reloc_code_real_type reloc) + extended_bfd_reloc_code_real_type reloc) { const struct alpha_operand *reloc_operand = NULL; const expressionS *reloc_exp = NULL; @@ -2125,7 +2132,8 @@ assemble_insn (const struct alpha_opcode *opcode, else if (reloc < BFD_RELOC_UNUSED && reloc > 0) { reloc_howto_type *reloc_howto - = bfd_reloc_type_lookup (stdoutput, reloc); + = bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) reloc); if (reloc_operand == NULL || reloc_howto->bitsize != reloc_operand->bits) { @@ -2168,7 +2176,7 @@ emit_ir_load (const expressionS *tok, basereg = tok[2].X_add_number; lituse = load_expression (tok[0].X_add_number, &tok[1], - &basereg, &newtok[1], opname); + &basereg, &newtok[1], (const char *) opname); if (basereg == alpha_gp_register && (symlen > 4 && strcmp (&symname [symlen - 4], "..lk") == 0)) @@ -2215,7 +2223,7 @@ emit_loadstore (const expressionS *tok, as_bad (_("macro requires $at register while noat in effect")); lituse = load_expression (AXP_REG_AT, &tok[1], - &basereg, &newtok[1], opname); + &basereg, &newtok[1], (const char *) opname); } else { @@ -3290,7 +3298,7 @@ assemble_tokens (const char *opname, const struct alpha_opcode *opcode; const struct alpha_macro *macro; int cpumatch = 1; - bfd_reloc_code_real_type reloc = BFD_RELOC_UNUSED; + extended_bfd_reloc_code_real_type reloc = BFD_RELOC_UNUSED; #ifdef RELOC_OP_P /* If a user-specified relocation is present, this is not a macro. */ @@ -3723,7 +3731,8 @@ s_alpha_ent (int dummy ATTRIBUTE_UNUSED) sym = symbol_find_or_make (name); symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION; - cur_frame_data = calloc (1, sizeof (*cur_frame_data)); + cur_frame_data = (struct alpha_elf_frame_data *) + calloc (1, sizeof (*cur_frame_data)); cur_frame_data->func_sym = sym; /* Provide sensible defaults. */ @@ -3779,7 +3788,7 @@ s_alpha_end (int dummy ATTRIBUTE_UNUSED) if (sym && cur_frame_data) { OBJ_SYMFIELD_TYPE *obj = symbol_get_obj (sym); - expressionS *exp = xmalloc (sizeof (expressionS)); + expressionS *exp = (expressionS *) xmalloc (sizeof (expressionS)); obj->size = exp; exp->X_op = O_subtract; @@ -3947,7 +3956,7 @@ s_alpha_file (int ignore ATTRIBUTE_UNUSED) discard_rest_of_line (); len = input_line_pointer - start; - first_file_directive = xmalloc (len + 1); + first_file_directive = (char *) xmalloc (len + 1); memcpy (first_file_directive, start, len); first_file_directive[len] = '\0'; @@ -5425,7 +5434,7 @@ md_begin (void) if ((slash = strchr (name, '/')) != NULL) { - char *p = xmalloc (strlen (name)); + char *p = (char *) xmalloc (strlen (name)); memcpy (p, name, slash - name); strcpy (p + (slash - name), slash + 1); @@ -6207,8 +6216,8 @@ tc_gen_reloc (asection *sec ATTRIBUTE_UNUSED, { arelent *reloc; - reloc = xmalloc (sizeof (* reloc)); - reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + reloc = (arelent *) xmalloc (sizeof (* reloc)); + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; |