Fix trace file fails on powerpc64
Commit Message
Ulrich Weigand <uweigand@de.ibm.com> writes:
> This will break powerpc64le, which uses the ELFv2 ABI without function
> descriptors. The correct test should be something like
>
> #elif defined __powerpc64__ && _CALL_ELF != 2
OK, fixed.
>
> OK with that change.
Patch below is pushed in.
@@ -1,3 +1,9 @@
+2014-10-27 Yao Qi <yao@codesourcery.com>
+
+ * gdb.trace/tfile.c (adjust_function_address)
+ [__powerpc64__ && _CALL_ELF != 2]: Get function address from
+ function descriptor.
+
2014-10-24 Don Breazeal <donb@codesourcery.com>
* gdb.base/foll-fork.exp (test_follow_fork,
@@ -130,6 +130,9 @@ adjust_function_address (uintptr_t func_addr)
/* Although Thumb functions are two-byte aligned, function
pointers have the Thumb bit set. Clear it. */
return func_addr & ~1;
+#elif defined __powerpc64__ && _CALL_ELF != 2
+ /* Get function address from function descriptor. */
+ return *(uintptr_t *) func_addr;
#else
return func_addr;
#endif