This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] testsuite: dw2-ranges: declare function descriptors for ppc64 compatibility
- From: Edjunior Barbosa Machado <emachado at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 16 Feb 2011 16:46:57 -0200
- Subject: [PATCH] testsuite: dw2-ranges: declare function descriptors for ppc64 compatibility
Hi,
when running the testcase gdb.dwarf2/dw2-ranges.exp on ppc64, noticed that the
inferior fails in the first test (runto_main) with a segfault but then the
following 5 tests pass with success:
(gdb) break main
Breakpoint 1 at 0x10000584: file dw2-ranges.S, line 1.
(gdb) run
Starting program: /home/gdb/builds/build-64bit/gdb/testsuite/gdb.dwarf2/dw2-ranges
Program received signal SIGSEGV, Segmentation fault.
0x7d82100800000000 in ?? ()
(gdb) FAIL: gdb.dwarf2/dw2-ranges.exp: running to main in runto
info line main
Line 1 of "dw2-ranges.S" starts at address 0x10000584 <main> and ends at 0x10000588 <main2>.
(gdb) PASS: gdb.dwarf2/dw2-ranges.exp: info line main
...
The following patch adds function descriptors declarations to the inferior
source code (dw2-ranges*.S) for ppc64 compatibility. Successfully tested on
ppc32, ppc64 and x86 (however, I'm not sure if the current state of the
testcase is compatible with other architectures).
--
Edjunior Barbosa Machado
IBM Linux Technology Center
2011-02-16 Edjunior Machado <emachado@br.ibm.com>
gdb/
* gdb.dwarf2/dw2-ranges.S: Add .opd section with function
descriptors for ppc64 compatibility.
* gdb.dwarf2/dw2-ranges2.S: Likewise.
* gdb.dwarf2/dw2-ranges3.S: Likewise.
---
gdb/testsuite/gdb.dwarf2/dw2-ranges.S | 19 +++++++++++++++++++
gdb/testsuite/gdb.dwarf2/dw2-ranges2.S | 18 ++++++++++++++++++
gdb/testsuite/gdb.dwarf2/dw2-ranges3.S | 9 +++++++++
3 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.S b/gdb/testsuite/gdb.dwarf2/dw2-ranges.S
index f87e289..0400fdc 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.S
@@ -30,9 +30,18 @@
.text
.globl main
+#ifdef __powerpc64__
+ .section ".opd","aw"
+main:
+ .quad .main, .TOC.@tocbase, 0
+ .section ".text"
+ .type main, @function
+.main: .int 0
+#else
.func main
main: .int 0
.endfunc
+#endif
.size main, . - main
/* `.fini' section is here to make sure `dw2-ranges.S'
@@ -40,7 +49,17 @@ main: .int 0
.section .fini, "ax", @progbits
.globl func
+#ifdef __powerpc64__
+ .section ".opd","aw"
+func:
+ .quad .func, .TOC.@tocbase, 0
+ .section ".text"
+ .type func, @function
+.func:
+ .size func, . - func
+#else
.func func
func: .int 0
.endfunc
+#endif
.size func, . - func
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges2.S b/gdb/testsuite/gdb.dwarf2/dw2-ranges2.S
index e41e5b3..1e97471 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges2.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges2.S
@@ -30,9 +30,18 @@
.text
.globl main2
+#ifdef __powerpc64__
+ .section ".opd","aw"
+main2:
+ .quad .main2, .TOC.@tocbase, 0
+ .section ".text"
+ .type main2, @function
+.main2: .int 0
+#else
.func main2
main2: .int 0
.endfunc
+#endif
.size main2, . - main2
/* `.fini' section is here to make sure `dw2-ranges.S'
@@ -40,7 +49,16 @@ main2: .int 0
.section .fini, "ax", @progbits
.globl func2
+#ifdef __powerpc64__
+ .section ".opd","aw"
+func2:
+ .quad .func2, .TOC.@tocbase, 0
+ .section ".text"
+ .type func2, @function
+.func2: .int 0
+#else
.func func2
func2: .int 0
.endfunc
+#endif
.size func2, . - func2
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges3.S b/gdb/testsuite/gdb.dwarf2/dw2-ranges3.S
index e1539ce..ed1831d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges3.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges3.S
@@ -30,7 +30,16 @@
.text
.globl main3
+#ifdef __powerpc64__
+ .section ".opd","aw"
+main3:
+ .quad .main3, .TOC.@tocbase, 0
+ .section ".text"
+ .type main3, @function
+.main3: .int 0
+#else
.func main3
main3: .int 0
.endfunc
+#endif
.size main3, . - main3
--
1.7.2.3