aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2009-12-22 17:37:57 +0000
committerCary Coutant <ccoutant@gcc.gnu.org>2009-12-22 09:37:57 -0800
commit6e922f17ac29f0128968813d4a76be598c288fe3 (patch)
tree8b8eda15225f727375f702aed13a86f05c1b52d2 /gcc
parent56c511556722e73073c1626ef7e3822b13a80351 (diff)
downloadgcc-6e922f17ac29f0128968813d4a76be598c288fe3.zip
gcc-6e922f17ac29f0128968813d4a76be598c288fe3.tar.gz
gcc-6e922f17ac29f0128968813d4a76be598c288fe3.tar.bz2
re PR debug/42454 (debug_ranges table contains empty range for unused .text section with -ffunction-sections)
PR debug/42454 * dwarf2out.c (dwarf2out_finish): Don't output range for .text section unless .text section was used. Likewise for cold. From-SVN: r155402
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 38fed9a..3b14a38 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-12-22 Cary Coutant <ccoutant@google.com>
+
+ PR debug/42454
+ * dwarf2out.c (dwarf2out_finish): Don't output range for .text
+ section unless .text section was used. Likewise for cold.
+
2009-12-22 Brian Hackett <bhackett1024@gmail.com>
* doc/plugins.texi: Rename pre-genericize event.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index da04057..2296dc3 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -21218,10 +21218,11 @@ dwarf2out_finish (const char *filename)
add_AT_addr (comp_unit_die, DW_AT_low_pc, const0_rtx);
add_AT_addr (comp_unit_die, DW_AT_entry_pc, const0_rtx);
- add_AT_range_list (comp_unit_die, DW_AT_ranges,
- add_ranges_by_labels (text_section_label,
- text_end_label));
- if (flag_reorder_blocks_and_partition)
+ if (text_section_used)
+ add_AT_range_list (comp_unit_die, DW_AT_ranges,
+ add_ranges_by_labels (text_section_label,
+ text_end_label));
+ if (flag_reorder_blocks_and_partition && cold_text_section_used)
add_ranges_by_labels (cold_text_section_label,
cold_end_label);