From 471aa9e821d3677a6b46214cd65ee9cf18b79ef3 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Thu, 1 Oct 2009 18:25:13 +0200 Subject: [PATCH] Don't emit base address selection entry when it doesn't change base address --- libdw/c++/emit-other.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libdw/c++/emit-other.cc b/libdw/c++/emit-other.cc index a626be5a7..8d0ac5a7c 100644 --- a/libdw/c++/emit-other.cc +++ b/libdw/c++/emit-other.cc @@ -123,8 +123,11 @@ dwarf_output::writer::output_debug_loc (section_appender &appender) // xxx When this is being fixed, duplicate selection has to take // base address into account. So the set above will be set of // (location attr, base address) pairs. - write_form (inserter, DW_FORM_addr, (uint64_t)-1); - write_form (inserter, DW_FORM_addr, 0); + if (loc.begin ()->first.first > 0) + { + write_form (inserter, DW_FORM_addr, (uint64_t)-1); + write_form (inserter, DW_FORM_addr, 0); + } for (dwarf_output::location_attr::const_iterator jt = loc.begin (); jt != loc.end (); ++jt) -- 2.47.2