pub unsafe extern "C" fn opnd_create_far_rel_addr(
seg: reg_id_t,
addr: *mut c_void,
data_size: opnd_size_t,
) -> opnd_tExpand description
Returns a memory reference operand that refers to the address \p seg : \p addr, but will be encoded as a pc-relative address. It is up to the caller to ensure that the resulting address is reachable via a 32-bit signed displacement from the next instruction at emit time.
DR guarantees that all of its code caches, all client libraries and Extensions (though not copies of system libraries), and all client memory allocated through dr_thread_alloc(), dr_global_alloc(), dr_nonheap_alloc(), or dr_custom_alloc() with #DR_ALLOC_CACHE_REACHABLE, can reach each other with a 32-bit displacement. Thus, any normally-allocated data or any static data or code in a client library is guaranteed to be reachable from code cache code. Memory allocated through system libraries (including malloc, operator new, and HeapAlloc) is not guaranteed to be reachable: only memory directly allocated via DR’s API. The runtime option -reachable_heap can be used to guarantee that all memory is reachable.
If \p addr is not pc-reachable at encoding time and this operand is used in a load or store to or from the rax (or eax) register, an absolute form will be used (as though opnd_create_far_abs_addr() had been called).
The operand has data size \p data_size (must be a OPSZ_ constant).
To represent a 32-bit address (i.e., what an address size prefix indicates), simply zero out the top 32 bits of the address before passing it to this routine.
\note For 64-bit X86 DR builds only.