PowerPC64 ELFv2 ABI: skip global entry point code
[external/binutils.git] / gdb / testsuite / gdb.base / step-bt.c
index e772a8e..2551ebe 100644 (file)
@@ -23,10 +23,19 @@ hello (void)
   printf ("Hello world.\n");
 }
 
+/* The test case uses "break *hello" to make sure to step at the very
+   first instruction of the function.  This causes a problem running
+   the test on powerpc64le-linux, since the first instruction belongs
+   to the global entry point prologue, which is skipped when doing a
+   local direct function call.  To make sure that first instruction is
+   indeed being executed and the breakpoint hits, we make sure to call
+   the routine via an indirect call.  */
+void (*ptr) (void) = hello;
+
 int
 main (void)
 {
-  hello ();
+  ptr ();
 
   return 0;
 }