Blame SOURCES/gdb-rhbz1125820-ppc64le-enablement-34of37.patch

01917d
commit bc9a55253ed7122cfeee90cd23d964f44c8b0e6a
01917d
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
01917d
Date:   Tue Mar 25 15:39:32 2014 +0100
01917d
01917d
    Support gdb.asm/asm-source.exp on powerpc64le
01917d
    
01917d
    Add new powerpc64le.inc file appropriate for the ELFv2 ABI and
01917d
    use it to support the asm-source.exp test case on powerpc64le.
01917d
    
01917d
    gdb/testsuite/
01917d
    2014-03-25  Ulrich Weigand  <uweigand@de.ibm.com>
01917d
    
01917d
    	* gdb.asm/asm-source.exp: Handle powerpc64le-* targets.
01917d
    	* gdb.asm/powerpc64le.inc: New file.
01917d
01917d
Index: gdb-7.6.1/gdb/testsuite/gdb.asm/asm-source.exp
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/testsuite/gdb.asm/asm-source.exp
01917d
+++ gdb-7.6.1/gdb/testsuite/gdb.asm/asm-source.exp
01917d
@@ -97,6 +97,11 @@ switch -glob -- [istarget] {
01917d
     "mips*-*" {
01917d
         set asm-arch mips
01917d
     }
01917d
+    "powerpc64le-*" {
01917d
+        set asm-arch powerpc64le
01917d
+        set asm-flags "-a64 -I${srcdir}/${subdir} $obj_include"
01917d
+        append link-flags " -m elf64lppc"
01917d
+    }
01917d
     "powerpc*-*" {
01917d
         if { [is_lp64_target] } {
01917d
             set asm-arch powerpc64
01917d
Index: gdb-7.6.1/gdb/testsuite/gdb.asm/powerpc64le.inc
01917d
===================================================================
01917d
--- /dev/null
01917d
+++ gdb-7.6.1/gdb/testsuite/gdb.asm/powerpc64le.inc
01917d
@@ -0,0 +1,47 @@
01917d
+	comment "subroutine prologue"
01917d
+	.macro gdbasm_enter
01917d
+	stdu 1, -32(1)
01917d
+	mflr 0
01917d
+	std 0, 48(1)
01917d
+	.endm
01917d
+
01917d
+	comment "subroutine epilogue"
01917d
+	.macro gdbasm_leave
01917d
+	ld 0, 48(1)
01917d
+	mtlr 0
01917d
+	ld 1, 0(1)
01917d
+	blr
01917d
+	.endm
01917d
+
01917d
+	.macro gdbasm_call subr
01917d
+	bl \subr
01917d
+	nop
01917d
+	.endm
01917d
+
01917d
+	.macro gdbasm_several_nops
01917d
+	nop
01917d
+	nop
01917d
+	nop
01917d
+	nop
01917d
+	.endm
01917d
+
01917d
+	comment "exit (0)"
01917d
+	.macro gdbasm_exit0
01917d
+	comment "sys_exit"
01917d
+	li	0, 1
01917d
+	sc
01917d
+	.endm
01917d
+
01917d
+	comment "crt0 startup"
01917d
+	.macro gdbasm_startup
01917d
+	.abiversion 2
01917d
+	.p2align 2
01917d
+	.endm
01917d
+
01917d
+	comment "Declare a data variable"
01917d
+	.purgem gdbasm_datavar
01917d
+	.macro gdbasm_datavar name value
01917d
+	.section	".data"
01917d
+\name:
01917d
+	.long \value
01917d
+	.endm