From: Petr Machata Date: Thu, 1 Oct 2009 16:25:13 +0000 (+0200) Subject: Don't emit base address selection entry when it doesn't change base address X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fpmachata%2Fdwarf-writer;p=thirdparty%2Felfutils.git Don't emit base address selection entry when it doesn't change base address --- 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)