diff options
author | Daniel Jacobowitz <drow@false.org> | 2008-06-05 16:17:54 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2008-06-05 16:17:54 +0000 |
commit | 8d3854312650473c3244bc3c10767aa29751a754 (patch) | |
tree | 813b118fff95c896d09a779a36e571e1a18b403f /gdb/remote.c | |
parent | 7cfbafbcb4abd37b07dec657f5fe471530a45b48 (diff) | |
download | gdb-8d3854312650473c3244bc3c10767aa29751a754.zip gdb-8d3854312650473c3244bc3c10767aa29751a754.tar.gz gdb-8d3854312650473c3244bc3c10767aa29751a754.tar.bz2 |
* remote.c (get_offsets): Handle a single segment.
* symfile.c (symfile_map_offsets_to_segments): Allow more bases
than segments.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 429f30b..7e15873 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2134,6 +2134,16 @@ get_offsets (void) segments[1] = data->segment_bases[1] + data_addr; num_segments = 2; } + /* If the object file has only one segment, assume that it is text + rather than data; main programs with no writable data are rare, + but programs with no code are useless. Of course the code might + have ended up in the data segment... to detect that we would need + the permissions here. */ + else if (data && data->num_segments == 1) + { + segments[0] = data->segment_bases[0] + text_addr; + num_segments = 1; + } /* There's no way to relocate by segment. */ else do_segments = 0; |