Functions
eh_frame.cpp File Reference

Go to the source code of this file.

Functions

uint64_t decode_pointer (char **addr, uint64_t encoding)
 

Function Documentation

◆ decode_pointer()

uint64_t decode_pointer ( char **  addr,
uint64_t  encoding 
)

Decode Pointer

Decodes a pointer located at addr, given the provided encoding scheme. The whole reason this function exists is that for most pointers in an executable, not all of the address bits are needed. For example, on a 64bit system, most executables are well under 1GB, and thus, the vast majority of address bits are not needed to relay an address. To save space, pointers are encoded, and this function provides the decoding logic.

Note that for 64bit, you are only likely to PC relative addressing. This is because in 64bit, all of the code is relocatable.

Parameters
addrthe location of the encoded pointer. Note that this takes a double pointer. This is because the total size of the pointer is not know until it is decoded. Therefore, this function not only decodes but it also advances the address based on the size of the pointer.
encodingthe scheme by which the pointer is encoded.
Returns
the resulting pointer

Definition at line 33 of file eh_frame.cpp.