MichaelW wrote:marcov wrote:That reminds me, are globals RIP relative in FB (win64)?
See e.g. Eli Bendersky's
While I am familiar with IP-relative addressing in code, where a jump or call destination can be effectively encoded as a "displacement", and where the functional description of these operations makes perfect sense, IP-relative data addressing seems more than a little bizarre. The instruction pointer, which formerly was not directly accessible in code, now is directly accessible, and usable as part of an indirect-memory operand.
Not general data, but STATIC data. The static memory segments are typically fairly small (and remember, 64-bit STILL allows 2GB offsets, so small is relative), so if the OS allocates the static segments in the vicinity of the code that it belongs to, one can save some speed and make the code denser. (which improves branch performance etc). Moreover, since the property is bound to the symbol, exceptions can be made for very large symbols. (it seems the medium model does that already at 64kb, which was new for me)
It does have a tendency to frustrate assembler use though, which is why I mentioned it here.