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

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