aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-frv.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2008-11-19 21:17:07 +0000
committerKevin Buettner <kevinb@redhat.com>2008-11-19 21:17:07 +0000
commit9bc7b6c67c89b58420df6e016c5c66fc41aa699d (patch)
treef671ef49e084428d1b7bfbbf035294dfb99d9684 /gdb/solib-frv.c
parentd0107bb6ae60c56a23d5b24c78b050cc3c557943 (diff)
downloadgdb-9bc7b6c67c89b58420df6e016c5c66fc41aa699d.zip
gdb-9bc7b6c67c89b58420df6e016c5c66fc41aa699d.tar.gz
gdb-9bc7b6c67c89b58420df6e016c5c66fc41aa699d.tar.bz2
* frv-tdep.c (frv_skip_main_prologue): New function.
(frv_gdbarch_init): Register frv_skip_main_prologue. * solib-frv.c (fetch_loadmap): Return early when no segments are found. (frv_relocate_main_executable): Return early when both interpreter and executable loadmap addresses are zero.
Diffstat (limited to 'gdb/solib-frv.c')
-rw-r--r--gdb/solib-frv.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 189fbe0..a8ef73b 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -124,6 +124,9 @@ fetch_loadmap (CORE_ADDR ldmaddr)
nsegs = extract_unsigned_integer (ext_ldmbuf_partial.nsegs,
sizeof ext_ldmbuf_partial.nsegs);
+ if (nsegs <= 0)
+ return NULL;
+
/* Allocate space for the complete (external) loadmap. */
ext_ldmbuf_size = sizeof (struct ext_elf32_fdpic_loadmap)
+ (nsegs - 1) * sizeof (struct ext_elf32_fdpic_loadseg);
@@ -860,16 +863,17 @@ static void
frv_relocate_main_executable (void)
{
int status;
- CORE_ADDR exec_addr;
+ CORE_ADDR exec_addr, interp_addr;
struct int_elf32_fdpic_loadmap *ldm;
struct cleanup *old_chain;
struct section_offsets *new_offsets;
int changed;
struct obj_section *osect;
- status = frv_fdpic_loadmap_addresses (target_gdbarch, 0, &exec_addr);
+ status = frv_fdpic_loadmap_addresses (target_gdbarch,
+ &interp_addr, &exec_addr);
- if (status < 0)
+ if (status < 0 || (exec_addr == 0 && interp_addr == 0))
{
/* Not using FDPIC ABI, so do nothing. */
return;