'For shared libraries (or PIE executables), many ELF fields may
contain offsets rather than actual pointers. If the ELF type is \'DYN\',
the argument may be an offset. It will not necessarily be an offset,
because the run-time linker may have fixed it up to be a real pointer
already. In this case an educated guess is made, and the ELF base
address is added to the value if it is determined to be an offset.'

def _make_absolute_ptr(self, ptr_or_offset):

    if_ptr = ptr_or_offset
    if_offset = (ptr_or_offset + self.libbase)
    if (self.elftype != 'DYN'):
        return if_ptr
    if (0 < ptr_or_offset < self.libbase):
        return if_offset
    else:
        return if_ptr
