aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 98c5c45..dbb84d9 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -675,7 +675,27 @@ symbol_file_command (args, from_tty)
}
else
{
- name = *argv;
+ char *p;
+
+ name = *argv;
+
+ /* this is for rombug remote only, to get the text relocation by
+ using link command */
+ p = strrchr(name, '/');
+ if (p != NULL) p++;
+ else p = name;
+
+ target_link(p, &text_relocation);
+
+ if (text_relocation == (CORE_ADDR)0)
+ return;
+ else if (text_relocation == (CORE_ADDR)-1)
+ symbol_file_add (name, from_tty, (CORE_ADDR)0, 1, mapped, readno
+w);
+ else
+ symbol_file_add (name, from_tty, (CORE_ADDR)text_relocation, 0,
+mapped, readnow);
+ set_initial_language ();
}
argv++;
}
@@ -684,25 +704,6 @@ symbol_file_command (args, from_tty)
{
error ("no symbol file name was specified");
}
- else
- {
- char *p;
-
- /* If target_link can find out where the file is,
- more power to it. */
- p = strrchr (name, '/');
- if (p != NULL) p++;
- else p = name;
-
- target_link (p, &text_relocation);
- if (text_relocation == (CORE_ADDR)-1)
- text_relocation = 0;
-
- symbol_file_add (name, from_tty, text_relocation, 1, mapped,
- readnow);
- set_initial_language ();
- }
-
do_cleanups (cleanups);
}
}