This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Initialize padding in gdb.base/relocate.c
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 28 Feb 2004 12:53:39 -0500
- Subject: [patch] Initialize padding in gdb.base/relocate.c
The point of the dummy array is to change the addresses of the global
variables within the data segment. Unfortunately, it was initialized to
zeros; recent GCC versions will put zero-initialized data in .bss by
default, thus defeating the point. So just initialize it to something else.
Will commit in a day or two.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-02-28 Daniel Jacobowitz <drow@mvista.com>
* gdb.base/relocate.c (dummy): Initialize.
Index: gdb/testsuite/gdb.base/relocate.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.base/relocate.c,v
retrieving revision 1.2
diff -u -p -r1.2 relocate.c
--- gdb/testsuite/gdb.base/relocate.c 24 Jul 2003 18:45:43 -0000 1.2
+++ gdb/testsuite/gdb.base/relocate.c 19 Feb 2004 20:56:43 -0000
@@ -3,7 +3,7 @@ static int static_bar = 2;
/* This padding is just for the benefit of the test harness. It
causes the globals to have different addresses than the functions. */
-int dummy[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+int dummy[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
int global_foo = 3;
int global_bar = 4;