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

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