From: Petr Machata Date: Fri, 20 Mar 2009 14:26:07 +0000 (+0100) Subject: dwarflint: Better handling of empty line programs X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c2b6c57dadd1f074145af4ec2b20671115a69f4;p=thirdparty%2Felfutils.git dwarflint: Better handling of empty line programs --- diff --git a/src/dwarflint.c b/src/dwarflint.c index c84dbd92f..d2654c7af 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -4926,6 +4926,7 @@ check_line_structural (struct section_data *data, bool terminated = false; bool first_file = true; + bool seen_opcode = false; while (!read_ctx_eof (&sub_ctx)) { where_reset_2 (&where, read_ctx_get_offset (&sub_ctx)); @@ -5114,6 +5115,12 @@ check_line_structural (struct section_data *data, use_file (1); first_file = false; } + + if (opcode != 0 || extended != DW_LNE_end_sequence) + seen_opcode = true; + + if (terminated) + break; } for (size_t i = 0; i < include_directories.size; ++i) @@ -5128,9 +5135,15 @@ check_line_structural (struct section_data *data, &where, ": the file #%zd `%s' is not used.\n", i + 1, files.files[i].name); + if (!seen_opcode) + wr_message (mc_line | mc_acc_bloat | mc_impact_3, &where, + ": empty line number program.\n"); if (!terminated) - wr_error (&where, - ": sequence of opcodes not terminated with DW_LNE_end_sequence.\n"); + { + if (seen_opcode) + wr_error (&where, + ": sequence of opcodes not terminated with DW_LNE_end_sequence.\n"); + } else if (sub_ctx.ptr != sub_ctx.end && !check_zero_padding (&sub_ctx, mc_line, &WHERE (sec_line, NULL)))