]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Don't emit base address selection entry when it doesn't change base address pmachata/dwarf-writer
authorPetr Machata <pmachata@redhat.com>
Thu, 1 Oct 2009 16:25:13 +0000 (18:25 +0200)
committerPetr Machata <pmachata@redhat.com>
Thu, 1 Oct 2009 16:25:13 +0000 (18:25 +0200)
libdw/c++/emit-other.cc

index a626be5a7bf49ef59a2f69104744a0849dac8345..8d0ac5a7c1cf30f214b78a5db78188dfc232619c 100644 (file)
@@ -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)