summaryrefslogtreecommitdiff
path: root/gdb/solib-frv.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2007-04-27 22:20:06 +0000
committerKevin Buettner <kevinb@redhat.com>2007-04-27 22:20:06 +0000
commitd9453d0bbbf4bbe9561ee328a14b6fd723145566 (patch)
treee7d9fc16768fd04582e5b6072ef53b5b6553a66a /gdb/solib-frv.c
parent9c7ca344707b19052fafdca270ce26350d92ed4b (diff)
downloadgdb-d9453d0bbbf4bbe9561ee328a14b6fd723145566.tar.gz
* solib-frv.c (lm_base): Bail out if the main executable has
not been relocated.
Diffstat (limited to 'gdb/solib-frv.c')
-rw-r--r--gdb/solib-frv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 5d2c9a12fc0..f9f966df57a 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -361,6 +361,14 @@ lm_base (void)
CORE_ADDR addr;
gdb_byte buf[FRV_PTR_SIZE];
+ /* One of our assumptions is that the main executable has been relocated.
+ Bail out if this has not happened. (Note that post_create_inferior()
+ in infcmd.c will call solib_add prior to solib_create_inferior_hook().
+ If we allow this to happen, lm_base_cache will be initialized with
+ a bogus value. */
+ if (main_executable_lm_info == 0)
+ return 0;
+
/* If we already have a cached value, return it. */
if (lm_base_cache)
return lm_base_cache;