From: H. P. A. <hp...@zy...> - 2016-04-21 05:37:45
|
On 04/12/16 17:04, Knut St. Osmundsen wrote: > Hi! > > Ran into a little problem with the OMF output backend and relocations of > RIP relative addresses followed by an immediate. For example this: > and byte [rel g_bBs3CurrentMode wrt BS3FLAT], ~0x0f > ended up 2 bytes after the g_bBs3CurrentMode symbol. > > Problem was that the adjusting was done the wrong way, instead of > subtracting the size of the immediate value, it was added. The patch > below explains it in (too much?) details and fixes the problem for me. > > Unless nasm has some way of defining data with a relative reference as > value (along the lines of "dd rel somesymbol" or "this: dd (somesymbol - > this - 4)") that I don't know about, AFAIK the size != realsize() > problem should never happen with 16-bit and 32-bit x86 instruction, only > when encoding RIP relative addresses in 64-bit mode. > Not yet, but before that happens we are planning to rework some of the backend interface anyway. -hpa |