Fix MSB shift in prelink adjusting debug info

Joseph S. Myers joseph@codesourcery.com
Thu Aug 6 23:52:00 GMT 2009


This patch fixes an incorrect shift by 58 instead of 56 when computing the 
most significant byte when prelink adjusts debug info.  Please commit if 
OK.

This problem manifests itself as test failures for SPARC64 but not other 
platforms I've tested, probably because the mmap_base setting for that 
platform has a nonzero MSB and most others don't.

2009-08-06  Joseph Myers  <joseph@codesourcery.com>

	* src/dwarf2.c (dwarf2_write_le64, dwarf2_write_be64): Shift by 56
	not 58 for MSB.

Index: src/dwarf2.c
===================================================================
--- src/dwarf2.c	(revision 173)
+++ src/dwarf2.c	(working copy)
@@ -115,7 +115,7 @@
   p[4] = val >> 32;
   p[5] = val >> 40;
   p[6] = val >> 48;
-  p[7] = val >> 58;
+  p[7] = val >> 56;
 }
 
 static void
@@ -139,7 +139,7 @@
   p[3] = val >> 32;
   p[2] = val >> 40;
   p[1] = val >> 48;
-  p[0] = val >> 58;
+  p[0] = val >> 56;
 }
 
 static struct

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Prelink mailing list