From 3a47045432484224045297da5e3254941c93b071 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Thu, 20 Oct 1994 05:15:46 +0000 Subject: * 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. --- gdb/objfiles.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'gdb/objfiles.c') 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; -- cgit v1.1