|
From: Tom H. <th...@cy...> - 2004-04-21 15:16:48
|
CVS commit by thughes:
Initialise %cs, %ds and %ss in the virtual machine to match the values
supplied by the operating system for the code, data and stack segments.
Explicit references using these segments still won't work but they
will at least produce an assertion to indicate that they aren't
supported instead of raising a segmentation fault in the target
program because of an apparent privilege violation.
M +12 -0 vg_main.c 1.149
--- valgrind/coregrind/vg_main.c #1.148:1.149
@@ -2428,4 +2428,16 @@ static void init_baseBlock ( Addr client
VGOFF_(m_gs) = alloc_BaB_1_set(0);
+ /* initialise %cs, %ds and %ss to point at the operating systems
+ default code, data and stack segments */
+ asm volatile("movw %%cs, %0"
+ :
+ : "m" (VG_(baseBlock)[VGOFF_(m_cs)]));
+ asm volatile("movw %%ds, %0"
+ :
+ : "m" (VG_(baseBlock)[VGOFF_(m_ds)]));
+ asm volatile("movw %%ss, %0"
+ :
+ : "m" (VG_(baseBlock)[VGOFF_(m_ss)]));
+
VG_(register_noncompact_helper)( (Addr) & VG_(do_useseg) );
|