gold: Fix 64-bit sparc GOLD crash in gdb-index code.
authorDavid S. Miller <davem@redhat.com>
Tue, 17 Apr 2012 02:10:39 +0000 (02:10 +0000)
committerDavid S. Miller <davem@redhat.com>
Tue, 17 Apr 2012 02:10:39 +0000 (02:10 +0000)
gold/

* gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
writing out 64-bit part of ranges.

gold/ChangeLog
gold/gdb-index.cc

index 51779fbcbdd8b3aa3cfb79835746c70da2252778..c9bfd7972658523d684ec3818f140ad281fb0b53 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-16  David S. Miller  <davem@davemloft.net>
 
+       * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
+       writing out 64-bit part of ranges.
+
        * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
        -fpic and -fpie respectively.
        * Makefile.in: Regenerate.
index 16e387180fdfe7236eb078998ab9c64b9f768bbc..07ba2ab54272ede494fd8e6dcaefd62eb9fa8440 100644 (file)
@@ -1166,8 +1166,8 @@ Gdb_index::do_write(Output_file* of)
              base = (os->address()
                      + object->output_section_offset(range.shndx));
            }
-         elfcpp::Swap<64, false>::writeval(pov, base + range.start);
-         elfcpp::Swap<64, false>::writeval(pov + 8, base + range.end);
+         elfcpp::Swap_unaligned<64, false>::writeval(pov, base + range.start);
+         elfcpp::Swap_unaligned<64, false>::writeval(pov + 8, base + range.end);
          elfcpp::Swap<32, false>::writeval(pov + 16, cu_index);
          pov += 20;
        }