'Prepare the address space with the data necessary to perform relocations pointing to the given symbol.
Returns a 2-tuple. The first item is the address of the function code, the second is the address of the
relocation target.'

def prepare_function_symbol(self, symbol_name, basic_addr=None):

    if self.project.loader.main_object.is_ppc64_abiv1:
        if (basic_addr is not None):
            pointer = self.project.loader.memory.read_addr_at(basic_addr)
            return (pointer, basic_addr)
        pseudo_hookaddr = self.project.loader.extern_object.get_pseudo_addr(symbol_name)
        pseudo_toc = self.project.loader.extern_object.allocate(size=24)
        self.project.loader.extern_object.memory.write_addr_at(AT.from_mva(pseudo_toc, self.project.loader.extern_object).to_rva(), pseudo_hookaddr)
        return (pseudo_hookaddr, pseudo_toc)
    else:
        if (basic_addr is None):
            basic_addr = self.project.loader.extern_object.get_pseudo_addr(symbol_name)
        return (basic_addr, basic_addr)
