+#ifdef LTTNG_CONFIG_PPC64_ELF_ABI_V2
+ /* Substract 4 bytes to get what we originally want */
+ addr = (unsigned long)(((char *)probe.addr) - 4);
+#elif defined(LTTNG_CONFIG_PPC64_ELF_ABI_V1)
+ /*
+ * Build a function descriptor from the address of
+ * 'kallsyms_lookup_name' returned by kprobe and the toc of
+ * 'sprint_symbol' which is in the same compile unit and exported. I
+ * hate this on so many levels but it works.
+ */
+ kallsyms_lookup_name_func_desc.LTTNG_FUNC_DESC_ADDR_NAME = (unsigned long) probe.addr;
+ kallsyms_lookup_name_func_desc.toc = ((LTTNG_FUNC_DESC_TYPE *) &sprint_symbol)->toc;
+ addr = (unsigned long) &kallsyms_lookup_name_func_desc;
+#else