|
From: John R.
|
> valgrind-2.4.0:
> ==21494== Valgrind detected that your program requires
> ==21494== the following unimplemented functionality:
> ==21494== x86 segment override (SEG=SS) prefix
Hopefully valgrind has reported the address of the offending instruction.
In the worst case you can fix them one at a time, as noted below.
> I don't have access to the code that uses this thing, it is inside a
> libary that I bought. Another problem is that althought I know something
> of Intel 32bits x86 Assembler I really don't know what is "segment
> override (SEG=SS) prefix".
Linux on i386 and up uses a "flat" address space map, with ss==es==ds.
[Write a hello.c program, invoke gdb on it, put a breakpoint on main(),
and run the program. When the breakpoint is hit, say "info reg"
and note that ss==es==ds==0x2b.] Thus the segment prefixes {ss, es, ds}
are interchangeable, including the default of no prefix at all (which
usually implies DS, except for some string instructions where the default
is ES.)
So, if the SS prefix is first (also there could be any of: OperandSize 0x66
[switch 16<->32 bit data], AddressSize 0x67 [switch 16<->32 bit address],
Lock 0xf0, and 2-byte opcode escape 0x0f), then it is safe to change
the SEG =SS prefix byte 0x36 into a NOP 0x90; use a binary file editor.
Otherwise: re-arrange the prefixes so that SS is first (the order does
not matter, except possibly that the 2-byte opcode escape 0x0f might
have to be last), then change it to NOP.
Either valgrind should implement all segment prefixes (it must implement
the GS segment prefix anyway to deal with gcc+glibc pthreads, and the
other segment overrides require exactly the same work), or at worst
valgrind should check that ss==ds, then ignore the SS prefix. In other
words, valgrind 2.4.0 is lazy in the derogatory sense.
--
|