summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2011-03-18 10:05:57 +0100
committerPetr Machata <pmachata@redhat.com>2011-03-18 10:05:57 +0100
commita363ed8b8075b169c037f1fd4fd80d85f18a9d7e (patch)
tree9a409762be096d60f41fda3accaa62dfcf5caa8b
parent68d1c27284699ce2316f8c1edae72606653444ce (diff)
downloadelfutils-a363ed8b8075b169c037f1fd4fd80d85f18a9d7e.tar.gz
dwarflint: DW_AT_high_pc always has to be >= DW_AT_low_pc
-rw-r--r--dwarflint/check_debug_info.cc2
-rwxr-xr-xdwarflint/tests/run-bad.sh3
-rwxr-xr-xdwarflint/tests/run-debug_abbrev-duplicate-attribute.sh1
3 files changed, 5 insertions, 1 deletions
diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc
index e01b4c9c..b64a82eb 100644
--- a/dwarflint/check_debug_info.cc
+++ b/dwarflint/check_debug_info.cc
@@ -967,7 +967,7 @@ namespace
"DW_AT_low_pc and DW_AT_high_pc");
/* If there is no coverage, these attributes should
not ever be there. */
- if (low_pc > high_pc || (low_pc == high_pc && low_pc > 0))
+ if (low_pc > high_pc || low_pc == high_pc)
wr_message (where, mc_die_other | mc_impact_3)
<< "DW_AT_low_pc value not below DW_AT_high_pc."
<< std::endl;
diff --git a/dwarflint/tests/run-bad.sh b/dwarflint/tests/run-bad.sh
index fc14f803..6e6db3ff 100755
--- a/dwarflint/tests/run-bad.sh
+++ b/dwarflint/tests/run-bad.sh
@@ -47,6 +47,7 @@ error: .debug_info: DIE 0xab: toplevel DIE chain contains more than one DIE.
EOF
testrun_compare ./dwarflint empty-1 <<EOF
+warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc.
warning: .debug_line: table 0: no CU uses this line table.
error: .debug_info: DIE 0x29 (abbr. attribute 0x13): references .debug_line table, but CU DIE lacks DW_AT_stmt_list.
EOF
@@ -106,6 +107,7 @@ EOF
testrun_compare ./dwarflint garbage-10 <<EOF
warning: .rela.debug_info: offset 0xc: relocation formed using STT_SECTION symbol with non-zero value.
error: .rela.debug_info: offset 0x11: couldn't obtain symbol #7208969: invalid section index.
+warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc.
EOF
testrun_compare ./dwarflint garbage-11 <<EOF
@@ -120,6 +122,7 @@ warning: .debug_info: CU 0: abbrev table offset seems to lack a relocation
warning: .debug_info: DIE 0xb (abbr. attribute 0): strp seems to lack a relocation
warning: .debug_info: DIE 0xb (abbr. attribute 0x4): strp seems to lack a relocation
warning: .debug_info: DIE 0xb (abbr. attribute 0xa): data4 seems to lack a relocation
+warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc.
error: .debug_line: table 0: header claims that it has a size of 542, but in fact it has a size of 30.
error: .debug_info: DIE 0xb (abbr. attribute 0xa): unresolved reference to .debug_line table 0x0.
EOF
diff --git a/dwarflint/tests/run-debug_abbrev-duplicate-attribute.sh b/dwarflint/tests/run-debug_abbrev-duplicate-attribute.sh
index 1e73d207..d6d2937f 100755
--- a/dwarflint/tests/run-debug_abbrev-duplicate-attribute.sh
+++ b/dwarflint/tests/run-debug_abbrev-duplicate-attribute.sh
@@ -33,4 +33,5 @@ testrun_compare ./dwarflint debug_abbrev-duplicate-attribute <<EOF
error: .debug_abbrev: abbr. attribute 0x19: duplicate attribute byte_size (first was at 0x13).
error: .debug_abbrev: abbr. attribute 0x1b: duplicate attribute decl_file (first was at 0x15).
error: .debug_abbrev: abbr. attribute 0x1d: duplicate attribute decl_line (first was at 0x17).
+warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc.
EOF