From dc1e8a474f904419abaa27da4be5b0f735a87255 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 25 Feb 2020 15:34:46 +1030 Subject: Indent labels Labels don't go in the first column according to standard emacs C indent rules, and I got annoyed enough at seeing diff -p show a label rather than the function name to fix this. bfd/ * aoutx.h: Indent labels correctly. Format error strings. * archive.c: Likewise. * archive64.c: Likewise. * coff-arm.c: Likewise. * coff-rs6000.c: Likewise. * coff-stgo32.c: Likewise. * cpu-arm.c: Likewise. * dwarf2.c: Likewise. * elf-ifunc.c: Likewise. * elf-properties.c: Likewise. * elf-s390-common.c: Likewise. * elf-strtab.c: Likewise. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-csky.c: Likewise. * elf32-i386.c: Likewise. * elf32-m68k.c: Likewise. * elf32-msp430.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-pru.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfnn-riscv.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-x86.c: Likewise. * i386lynx.c: Likewise. * merge.c: Likewise. * pdp11.c: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. binutils/ * elfedit.c: Indent labels correctly. * readelf.c: Likewise. * resres.c: Likewise. gas/ * config/obj-elf.c: Indent labels correctly. * config/obj-macho.c: Likewise. * config/tc-aarch64.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-cr16.c: Likewise. * config/tc-crx.c: Likewise. * config/tc-frv.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nds32.c: Likewise. * config/tc-riscv.c: Likewise. * config/tc-s12z.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * read.c: Likewise. * symbols.c: Likewise. * write.c: Likewise. ld/ * emultempl/cskyelf.em: Indent labels correctly. * ldfile.c: Likewise. * ldlang.c: Likewise. * plugin.c: Likewise. opcodes/ * aarch64-asm.c: Indent labels correctly. * aarch64-dis.c: Likewise. * aarch64-gen.c: Likewise. * aarch64-opc.c: Likewise. * alpha-dis.c: Likewise. * i386-dis.c: Likewise. * nds32-asm.c: Likewise. * nfp-dis.c: Likewise. * visium-dis.c: Likewise. --- gas/ChangeLog | 24 ++++++++++++++++++++++++ gas/config/obj-elf.c | 6 +++--- gas/config/obj-macho.c | 2 +- gas/config/tc-aarch64.c | 14 +++++++------- gas/config/tc-alpha.c | 14 +++++++------- gas/config/tc-arm.c | 14 +++++++------- gas/config/tc-cr16.c | 4 ++-- gas/config/tc-crx.c | 10 +++++----- gas/config/tc-frv.c | 2 +- gas/config/tc-i386-intel.c | 2 +- gas/config/tc-i386.c | 12 ++++++------ gas/config/tc-ia64.c | 2 +- gas/config/tc-mn10200.c | 2 +- gas/config/tc-mn10300.c | 2 +- gas/config/tc-nds32.c | 6 +++--- gas/config/tc-riscv.c | 18 +++++++++--------- gas/config/tc-s12z.c | 2 +- gas/config/tc-xtensa.c | 4 ++-- gas/config/tc-z80.c | 2 +- gas/read.c | 4 ++-- gas/symbols.c | 2 +- gas/write.c | 2 +- 22 files changed, 87 insertions(+), 63 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index d472353..d00fb87 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,27 @@ +2020-02-26 Alan Modra + + * config/obj-elf.c: Indent labels correctly. + * config/obj-macho.c: Likewise. + * config/tc-aarch64.c: Likewise. + * config/tc-alpha.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-cr16.c: Likewise. + * config/tc-crx.c: Likewise. + * config/tc-frv.c: Likewise. + * config/tc-i386-intel.c: Likewise. + * config/tc-i386.c: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-mn10200.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-nds32.c: Likewise. + * config/tc-riscv.c: Likewise. + * config/tc-s12z.c: Likewise. + * config/tc-xtensa.c: Likewise. + * config/tc-z80.c: Likewise. + * read.c: Likewise. + * symbols.c: Likewise. + * write.c: Likewise. + 2020-02-20 Nelson Chu * config/tc-riscv.c (riscv_ip): New boolean insn_with_csr to indicate diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index a722598..a6dcdaf 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -1340,7 +1340,7 @@ obj_elf_section (int push) } } -done: + done: demand_empty_rest_of_line (); obj_elf_change_section (name, type, attr, entsize, &match, linkonce, @@ -1879,11 +1879,11 @@ obj_elf_vendor_attribute (int vendor) demand_empty_rest_of_line (); return tag; -bad_string: + bad_string: as_bad (_("bad string constant")); ignore_rest_of_line (); return 0; -bad: + bad: as_bad (_("expected , ")); ignore_rest_of_line (); return 0; diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c index c5ec05a..3788f82 100644 --- a/gas/config/obj-macho.c +++ b/gas/config/obj-macho.c @@ -587,7 +587,7 @@ obj_mach_o_zerofill (int ignore ATTRIBUTE_UNUSED) S_CLEAR_EXTERNAL (sym); } -done: + done: /* switch back to the section that was current before the .zerofill. */ subseg_set (old_seg, 0); } diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 4f9c603..7af56ba 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -883,7 +883,7 @@ parse_vector_type_for_operand (aarch64_reg_type reg_type, return FALSE; } -elt_size: + elt_size: switch (TOLOWER (*ptr)) { case 'b': @@ -2424,7 +2424,7 @@ parse_aarch64_imm_float (char **ccp, int *immed, bfd_boolean dp_p, *ccp = str; return TRUE; -invalid_fp: + invalid_fp: set_fatal_syntax_error (_("invalid floating-point constant")); return FALSE; } @@ -5216,7 +5216,7 @@ vectype_to_qualifier (const struct vector_type_el *vectype) return offset; } -vectype_conversion_fail: + vectype_conversion_fail: first_error (_("bad vector arrangement type")); return AARCH64_OPND_QLF_NIL; } @@ -6652,7 +6652,7 @@ parse_operands (char *str, const aarch64_opcode *opcode) case AARCH64_OPND_SYSREG_TLBI: inst.base.operands[i].sysins_op = parse_sys_ins_reg (&str, aarch64_sys_regs_tlbi_hsh); -sys_reg_ins: + sys_reg_ins: if (inst.base.operands[i].sysins_op == NULL) { set_fatal_syntax_error ( _("unknown or missing operation name")); @@ -6707,7 +6707,7 @@ sys_reg_ins: inst.base.operands[i].present = 1; continue; -failure: + failure: /* The parse routine should already have set the error, but in case not, set a default one here. */ if (! error_p ()) @@ -6773,7 +6773,7 @@ failure: (_("unexpected characters following instruction")); } -parse_operands_return: + parse_operands_return: if (error_p ()) { @@ -8263,7 +8263,7 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg) break; } -apply_fix_return: + apply_fix_return: /* Free the allocated the struct aarch64_inst. N.B. currently there are very limited number of fix-up types actually use this field, so the impact on the performance should be minimal . */ diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index bb8b68b..ef0f817 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -1021,7 +1021,7 @@ tokenize_arguments (char *str, } } -fini: + fini: if (saw_comma) goto err; input_line_pointer = old_input_line_pointer; @@ -1035,7 +1035,7 @@ fini: return ntok - (end_tok - tok); -err: + err: #ifdef RELOC_OP_P is_end_of_line[(unsigned char) '!'] = 0; #endif @@ -1043,7 +1043,7 @@ err: return TOKENIZE_ERROR; #ifdef RELOC_OP_P -err_report: + err_report: is_end_of_line[(unsigned char) '!'] = 0; #endif input_line_pointer = old_input_line_pointer; @@ -5136,7 +5136,7 @@ s_alpha_arch (int ignored ATTRIBUTE_UNUSED) } as_warn (_("Unknown CPU identifier `%s'"), name); -found: + found: (void) restore_line_pointer (ch); demand_empty_rest_of_line (); } @@ -5976,10 +5976,10 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg) goto done; } -write_done: + write_done: md_number_to_chars (fixpos, image, 4); -done: + done: fixP->fx_done = 1; } @@ -6343,7 +6343,7 @@ tc_get_register (int frame ATTRIBUTE_UNUSED) } as_warn (_("frame reg expected, using $%d."), framereg); -found: + found: note_gpreg (framereg); return framereg; } diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 102bedd..cfbee7e 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -4648,7 +4648,7 @@ s_arm_unwind_save_mmxwr (void) } return; -error: + error: ignore_rest_of_line (); } @@ -4716,7 +4716,7 @@ s_arm_unwind_save_mmxwcg (void) op = 0xc700 | mask; add_unwind_opcode (op, 2); return; -error: + error: ignore_rest_of_line (); } @@ -5091,7 +5091,7 @@ set_fp16_format (int dummy ATTRIBUTE_UNUSED) as_warn (_("float16 format cannot be set more than once, ignoring.")); } -cleanup: + cleanup: *input_line_pointer = saved_char; ignore_rest_of_line (); } @@ -6368,7 +6368,7 @@ parse_psr (char **str, bfd_boolean lhs) goto unsupported_psr; p += 4; -check_suffix: + check_suffix: if (*p == '_') { /* A suffix follows. */ @@ -18307,7 +18307,7 @@ do_mve_vmull (void) return; -neon_vmul: + neon_vmul: inst.instruction = N_MNEM_vmul; inst.cond = 0xb; if (thumb_mode) @@ -19707,7 +19707,7 @@ neon_scalar_for_fmac_fp16_long (unsigned scalar, unsigned quad_p) | ((elno & 0x1) << 3)); } -bad_scalar: + bad_scalar: first_error (_("scalar out of range for multiply instruction")); return 0; } @@ -32888,7 +32888,7 @@ get_aeabi_cpu_arch_from_fset (const arm_feature_set *arch_ext_fset, if (p_ver_ret == NULL) return -1; -found: + found: /* Tag_CPU_arch_profile. */ if (ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v7a) || ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v8) diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c index 8a8e566..7a8f33b 100644 --- a/gas/config/tc-cr16.c +++ b/gas/config/tc-cr16.c @@ -2329,8 +2329,8 @@ assemble_insn (const char *mnemonic, ins *insn) match = 1; break; -/* Try again with next instruction. */ -next_insn: + /* Try again with next instruction. */ + next_insn: instruction++; } diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c index 27b2d89..09efa09 100644 --- a/gas/config/tc-crx.c +++ b/gas/config/tc-crx.c @@ -900,8 +900,8 @@ parse_operand (char *operand, ins * crx_ins) cur_arg->type = arg_c; goto set_params; -/* Parse an operand according to its type. */ -set_params: + /* Parse an operand according to its type. */ + set_params: cur_arg->constant = 0; set_operand (operand, crx_ins); } @@ -1570,8 +1570,8 @@ assemble_insn (char *mnemonic, ins *insn) match = 1; break; -/* Try again with next instruction. */ -next_insn: + /* Try again with next instruction. */ + next_insn: instruction++; } @@ -1845,7 +1845,7 @@ preprocess_reglist (char *param, int *allocated) as_bad (_("Maximum %d bits may be set in `mask16' operand"), MAX_REGS_IN_MASK16); -next_inst: + next_inst: while (!ISALNUM (*paramP) && *paramP != '}') paramP++; } diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c index 9165055..48bbe59 100644 --- a/gas/config/tc-frv.c +++ b/gas/config/tc-frv.c @@ -858,7 +858,7 @@ frv_tomcat_analyze_vliw_chains (void) vliw1 = vliw_chain_top; -workaround_top: + workaround_top: FRV_SET_VLIW_WINDOW (vliw1, vliw2, vliw3); diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c index 76fc997..b326d30 100644 --- a/gas/config/tc-i386-intel.c +++ b/gas/config/tc-i386-intel.c @@ -509,7 +509,7 @@ static int i386_intel_simplify (expressionS *e) /* FALLTHROUGH */ default: -fallthrough: + fallthrough: if (e->X_add_symbol && !i386_intel_simplify_symbol (e->X_add_symbol)) return 0; diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index d118fdd..62b7cfb 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2189,7 +2189,7 @@ operand_size_match (const insn_template *t) if (!t->opcode_modifier.d) { -mismatch: + mismatch: if (!match) i.error = operand_size_mismatch; return match; @@ -2244,7 +2244,7 @@ operand_type_match (i386_operand_type overlap, if (given.bitfield.baseindex == overlap.bitfield.baseindex) return 1; -mismatch: + mismatch: i.error = operand_type_mismatch; return 0; } @@ -4792,7 +4792,7 @@ parse_insn (char *line, char *mnemonic) if (!current_templates) { -check_suffix: + check_suffix: if (mnem_p > mnemonic) { /* See if we can get a match by trimming off a suffix. */ @@ -6030,7 +6030,7 @@ match_template (char mnem_suffix) if (!t->opcode_modifier.d) continue; -check_reverse: + check_reverse: if (!(size_match & MATCH_REVERSE)) continue; /* Try reversing direction of operands. */ @@ -7075,7 +7075,7 @@ process_operands (void) } else { -duplicate: + duplicate: i.operands++; i.reg_operands++; i.tm.operands++; @@ -10404,7 +10404,7 @@ i386_index_check (const char *operand_string) else return 1; -bad_address: + bad_address: as_bad (_("`%s' is not a valid %s expression"), operand_string, kind); return 0; diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index f908ba5..a9126ab 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -11845,7 +11845,7 @@ dot_alias (int section) { as_fatal (_("inserting \"%s\" into %s name hash table failed: %s"), alias, kind, error_string); -out: + out: obstack_free (¬es, name); obstack_free (¬es, alias); } diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c index c901744..0558a37 100644 --- a/gas/config/tc-mn10200.c +++ b/gas/config/tc-mn10200.c @@ -1103,7 +1103,7 @@ md_assemble (char *str) break; } -keep_going: + keep_going: str = input_line_pointer; input_line_pointer = hold; diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c index 90721c6..c704d34 100644 --- a/gas/config/tc-mn10300.c +++ b/gas/config/tc-mn10300.c @@ -1759,7 +1759,7 @@ md_assemble (char *str) break; } -keep_going: + keep_going: str = input_line_pointer; input_line_pointer = hold; diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c index 06c5653..0f5973d 100644 --- a/gas/config/tc-nds32.c +++ b/gas/config/tc-nds32.c @@ -3501,7 +3501,7 @@ nds32_pseudo_opcode_wrapper (char *line, struct nds32_pseudo_opcode *opcode) } ++s; } while (s[0] != '\0'); -end: + end: /* Put the origin line for debugging. */ argv[argc] = line; opcode->proc (argc, argv, opcode->pseudo_val); @@ -4287,7 +4287,7 @@ nds32_relax_hint (int mode ATTRIBUTE_UNUSED) relax_hint_begin = 0; name = nds_itoa (relax_hint_id_current); -reordered_id: + reordered_id: /* Find relax hint entry for next instruction, and all member will be initialized at that time. */ @@ -6267,7 +6267,7 @@ nds32_elf_append_relax_relocs (const char *key, void *value) pattern_now = pattern_now->next; } -restore: + restore: now_seg = seg_bak; frchain_now = frchain_bak; } diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 1559b08..ddd4d14 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -1676,7 +1676,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, || imm_expr->X_add_number >= 64) break; ip->insn_opcode |= ENCODE_RVC_IMM (imm_expr->X_add_number); -rvc_imm_done: + rvc_imm_done: s = expr_end; imm_expr->X_op = O_absent; continue; @@ -1804,7 +1804,7 @@ rvc_imm_done: p = percent_op_utype; if (my_getSmallExpression (imm_expr, imm_reloc, s, p)) break; -rvc_lui: + rvc_lui: if (imm_expr->X_op != O_constant || imm_expr->X_add_number <= 0 || imm_expr->X_add_number >= RISCV_BIGIMM_REACH @@ -2114,10 +2114,10 @@ rvc_lui: goto alu_op; case '0': /* AMO "displacement," which must be zero. */ p = percent_op_null; -load_store: + load_store: if (riscv_handle_implicit_zero_offset (imm_expr, s)) continue; -alu_op: + alu_op: /* If this value won't fit into a 16 bit offset, then go find a macro that will generate the 32 bit offset code pattern. */ @@ -2136,7 +2136,7 @@ alu_op: continue; case 'p': /* PC-relative offset. */ -branch: + branch: *imm_reloc = BFD_RELOC_12_PCREL; my_getExpression (imm_expr, s); s = expr_end; @@ -2160,7 +2160,7 @@ branch: continue; case 'a': /* 20-bit PC-relative offset. */ -jump: + jump: my_getExpression (imm_expr, s); s = expr_end; *imm_reloc = BFD_RELOC_RISCV_JMP; @@ -2290,7 +2290,7 @@ jump: insn_with_csr = FALSE; } -out: + out: /* Restore the character we might have clobbered above. */ if (save_c) *(argsStart - 1) = save_c; @@ -3142,7 +3142,7 @@ md_convert_frag_branch (fragS *fragp) md_number_to_chars ((char *) buf, insn, 4); buf += 4; -jump: + jump: /* Jump to the target. */ fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, 4, &exp, FALSE, BFD_RELOC_RISCV_JMP); @@ -3162,7 +3162,7 @@ jump: abort (); } -done: + done: fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; diff --git a/gas/config/tc-s12z.c b/gas/config/tc-s12z.c index cb3ecfe..91480de 100644 --- a/gas/config/tc-s12z.c +++ b/gas/config/tc-s12z.c @@ -322,7 +322,7 @@ lex_imm (long *v, expressionS *exp_o) *v = exp.X_add_number; return true; -fail: + fail: fail_line_pointer = input_line_pointer; input_line_pointer = ilp; return false; diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 4440ed4..71d4d94 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -2047,13 +2047,13 @@ tokenize_arguments (char **args, char *str) } } -fini: + fini: if (saw_comma || saw_colon) goto err; input_line_pointer = old_input_line_pointer; return num_args; -err: + err: if (saw_comma) as_bad (_("extra comma")); else if (saw_colon) diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index 0ed43cb..8f92d9f 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -3622,7 +3622,7 @@ md_assemble (char *str) "first unrecognized character is `%c'"), *p); } } -end: + end: input_line_pointer = old_ptr; } diff --git a/gas/read.c b/gas/read.c index bf594f1..e603099 100644 --- a/gas/read.c +++ b/gas/read.c @@ -5810,7 +5810,7 @@ s_incbin (int x ATTRIBUTE_UNUSED) as_warn (_("truncated file `%s', %ld of %ld bytes read"), path, bytes, count); } -done: + done: if (binfile != NULL) fclose (binfile); if (path) @@ -5874,7 +5874,7 @@ s_include (int arg ATTRIBUTE_UNUSED) free (path); path = filename; -gotit: + gotit: /* malloc Storage leak when file is found on path. FIXME-SOMEDAY. */ register_dependency (path); input_scrub_insert_file (path); diff --git a/gas/symbols.c b/gas/symbols.c index 79cdb82..160b0f7 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -1638,7 +1638,7 @@ resolve_symbol_value (symbolS *symp) if (finalize_syms) S_SET_VALUE (symp, final_val); -exit_dont_set_value: + exit_dont_set_value: /* Always set the segment, even if not finalizing the value. The segment is used to determine whether a symbol is defined. */ S_SET_SEGMENT (symp, final_seg); diff --git a/gas/write.c b/gas/write.c index dfbbc7c..0a6f07a 100644 --- a/gas/write.c +++ b/gas/write.c @@ -443,7 +443,7 @@ cvt_frag_to_fill (segT sec ATTRIBUTE_UNUSED, fragS *fragP) #ifdef HANDLE_ALIGN HANDLE_ALIGN (fragP); #endif -skip_align: + skip_align: know (fragP->fr_next != NULL); fragP->fr_offset = (fragP->fr_next->fr_address - fragP->fr_address -- cgit v1.1