diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-10-20 05:15:46 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-10-20 05:15:46 +0000 |
commit | 3a47045432484224045297da5e3254941c93b071 (patch) | |
tree | b610063b08829f46eb73649728d94856ee17c9b8 /gdb/objfiles.c | |
parent | 459877ea9d6bf27d5f7337e2155fb33c0bd996b0 (diff) | |
download | gdb-3a47045432484224045297da5e3254941c93b071.zip gdb-3a47045432484224045297da5e3254941c93b071.tar.gz gdb-3a47045432484224045297da5e3254941c93b071.tar.bz2 |
* objfiles.c (objfile_relocate): When relocating ->sections, use
objfile not symfile_objfile.
* symtab.h, minsyms.c (minsyms_sort): New function.
* objfiles.c (objfile_relocate): Call it.
* remote-vx.c (vx_add_symbols): Call breakpoint_re_set.
* objfiles.c, objfiles.h (objfile_to_front): New function.
* remote-vx.c (vx_add_symbols): Call it.
* coffread.c (coff_symtab_read): Handle common symbols the same
way that partial-stab.h does.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 5cd01e5..891531d 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -273,6 +273,27 @@ allocate_objfile (abfd, mapped) return (objfile); } +/* Put OBJFILE at the front of the list. */ + +void +objfile_to_front (objfile) + struct objfile *objfile; +{ + struct objfile **objp; + for (objp = &object_files; *objp != NULL; objp = &((*objp)->next)) + { + if (*objp == objfile) + { + /* Unhook it from where it is. */ + *objp = objfile->next; + /* Put it in the front. */ + objfile->next = object_files; + object_files = objfile; + break; + } + } +} + /* Unlink OBJFILE from the list of known objfiles, if it is found in the list. @@ -551,6 +572,9 @@ objfile_relocate (objfile, new_offsets) if (SYMBOL_SECTION (msym) >= 0) SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym)); } + /* Relocating different sections by different amounts may cause the symbols + to be out of order. */ + msymbols_sort (objfile); { int i; @@ -562,10 +586,10 @@ objfile_relocate (objfile, new_offsets) struct obj_section *s; bfd *abfd; - abfd = symfile_objfile->obfd; + abfd = objfile->obfd; - for (s = symfile_objfile->sections; - s < symfile_objfile->sections_end; ++s) + for (s = objfile->sections; + s < objfile->sections_end; ++s) { flagword flags; |