Blame SOURCES/gdb-6.5-section-num-fixup-test.patch

01917d
diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-lib.c gdb-6.5/gdb/testsuite/gdb.base/datalib-lib.c
01917d
--- gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-lib.c	1969-12-31 19:00:00.000000000 -0500
01917d
+++ gdb-6.5/gdb/testsuite/gdb.base/datalib-lib.c	2008-05-29 13:51:50.000000000 -0400
01917d
@@ -0,0 +1,22 @@
01917d
+/* This testcase is part of GDB, the GNU debugger.
01917d
+
01917d
+   Copyright 2008 Free Software Foundation, Inc.
01917d
+
01917d
+   This program is free software; you can redistribute it and/or modify
01917d
+   it under the terms of the GNU General Public License as published by
01917d
+   the Free Software Foundation; either version 2 of the License, or
01917d
+   (at your option) any later version.
01917d
+
01917d
+   This program is distributed in the hope that it will be useful,
01917d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
01917d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
01917d
+   GNU General Public License for more details.
01917d
+ 
01917d
+   You should have received a copy of the GNU General Public License
01917d
+   along with this program; if not, write to the Free Software
01917d
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
01917d
+
01917d
+   Please email any bugs, comments, and/or additions to this file to:
01917d
+   bug-gdb@prep.ai.mit.edu  */
01917d
+
01917d
+int var;
01917d
diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-main.c gdb-6.5/gdb/testsuite/gdb.base/datalib-main.c
01917d
--- gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-main.c	1969-12-31 19:00:00.000000000 -0500
01917d
+++ gdb-6.5/gdb/testsuite/gdb.base/datalib-main.c	2008-05-29 13:51:39.000000000 -0400
01917d
@@ -0,0 +1,26 @@
01917d
+/* This testcase is part of GDB, the GNU debugger.
01917d
+
01917d
+   Copyright 2008 Free Software Foundation, Inc.
01917d
+
01917d
+   This program is free software; you can redistribute it and/or modify
01917d
+   it under the terms of the GNU General Public License as published by
01917d
+   the Free Software Foundation; either version 2 of the License, or
01917d
+   (at your option) any later version.
01917d
+
01917d
+   This program is distributed in the hope that it will be useful,
01917d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
01917d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
01917d
+   GNU General Public License for more details.
01917d
+ 
01917d
+   You should have received a copy of the GNU General Public License
01917d
+   along with this program; if not, write to the Free Software
01917d
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
01917d
+
01917d
+   Please email any bugs, comments, and/or additions to this file to:
01917d
+   bug-gdb@prep.ai.mit.edu  */
01917d
+
01917d
+int
01917d
+main (void)
01917d
+{
01917d
+  return 0;
01917d
+}
01917d
diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib.exp gdb-6.5/gdb/testsuite/gdb.base/datalib.exp
01917d
--- gdb-6.5-orig/gdb/testsuite/gdb.base/datalib.exp	1969-12-31 19:00:00.000000000 -0500
01917d
+++ gdb-6.5/gdb/testsuite/gdb.base/datalib.exp	2008-05-29 14:58:33.000000000 -0400
01917d
@@ -0,0 +1,51 @@
01917d
+# Copyright 2008 Free Software Foundation, Inc.
01917d
+
01917d
+# This program is free software; you can redistribute it and/or modify
01917d
+# it under the terms of the GNU General Public License as published by
01917d
+# the Free Software Foundation; either version 2 of the License, or
01917d
+# (at your option) any later version.
01917d
+# 
01917d
+# This program is distributed in the hope that it will be useful,
01917d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
01917d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
01917d
+# GNU General Public License for more details.
01917d
+# 
01917d
+# You should have received a copy of the GNU General Public License
01917d
+# along with this program; if not, write to the Free Software
01917d
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
01917d
+
01917d
+set testfile datalib
01917d
+set srcfilemain ${testfile}-main.c
01917d
+set srcfilelib ${testfile}-lib.c
01917d
+set libfile ${objdir}/${subdir}/${testfile}-lib.so
01917d
+set binfile ${objdir}/${subdir}/${testfile}-main
01917d
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfilelib}" "${libfile}" executable [list debug {additional_flags=-shared -nostdlib}]] != "" } {
01917d
+    untested "Couldn't compile test program"
01917d
+    return -1
01917d
+}
01917d
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfilemain}" "${binfile} ${libfile}" executable {debug}] != "" } {
01917d
+    untested "Couldn't compile test program"
01917d
+    return -1
01917d
+}
01917d
+
01917d
+# Get things started.
01917d
+
01917d
+gdb_exit
01917d
+gdb_start
01917d
+gdb_reinitialize_dir $srcdir/$subdir
01917d
+gdb_load ${binfile}
01917d
+
01917d
+# We must use a separate library as the main executable is compiled to the
01917d
+# address 0 by default and it would get fixed up already at the end of
01917d
+# INIT_OBJFILE_SECT_INDICES.  We also cannot PRELINK it as PRELINK is missing
01917d
+# on ia64.  The library must be NOSTDLIB as otherwise some stub code would
01917d
+# create the `.text' section there.  Also DEBUG option is useful as some of
01917d
+# the crashes occur in dwarf2read.c.
01917d
+
01917d
+# FAIL case:
01917d
+# ../../gdb/ia64-tdep.c:2838: internal-error: sect_index_text not initialized
01917d
+# A problem internal to GDB has been detected,
01917d
+
01917d
+gdb_test "start" \
01917d
+         "main \\(\\) at .*${srcfilemain}.*" \
01917d
+         "start"