From: Jim Kingdon Date: Mon, 29 Mar 1993 22:25:59 +0000 (+0000) Subject: * xcoffread.c (sort_syms, compare_symbols): Remove. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e5c007603f1d64f2f5722cb6f79227b5fd0f9350;p=binutils-gdb.git * xcoffread.c (sort_syms, compare_symbols): Remove. (xcoff_symfile_read): Use sort_all_symtab_syms from symfile.c not our own sort_syms (it is identical). --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cd4b3e9bf40..b5aadf8719e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ Mon Mar 29 13:55:29 1993 Jim Kingdon (kingdon@cygnus.com) + * xcoffread.c (sort_syms, compare_symbols): Remove. + (xcoff_symfile_read): Use sort_all_symtab_syms from symfile.c + not our own sort_syms (it is identical). + * xcoffread.c: Nuke NAMES_HAVE_DOT define (not used). Fri Mar 26 11:29:30 1993 Jim Kingdon (kingdon@cygnus.com) diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 5336ec855ac..6299cb8055d 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -215,64 +215,6 @@ read_xcoff_symtab PARAMS ((struct objfile *, int)); static void add_stab_to_list PARAMS ((char *, struct pending_stabs **)); -static void -sort_syms PARAMS ((void)); - -static int -compare_symbols PARAMS ((const void *, const void *)); - -/* Call sort_syms to sort alphabetically - the symbols of each block of each symtab. */ - -static int -compare_symbols (s1p, s2p) - const PTR s1p; - const PTR s2p; -{ - /* Names that are less should come first. */ - register struct symbol **s1 = (struct symbol **) s1p; - register struct symbol **s2 = (struct symbol **) s2p; - register int namediff = STRCMP (SYMBOL_NAME (*s1), SYMBOL_NAME (*s2)); - if (namediff != 0) - return namediff; - - /* For symbols of the same name, registers should come first. */ - return ((SYMBOL_CLASS (*s2) == LOC_REGISTER) - - (SYMBOL_CLASS (*s1) == LOC_REGISTER)); -} - - -/* Sort a vector of symbols by their value. */ - -static void -sort_syms () -{ - register struct symtab *s; - register struct objfile *objfile; - register int i, nbl; - register struct blockvector *bv; - register struct block *b; - - for (objfile = object_files; objfile != NULL; objfile = objfile -> next) - { - for (s = objfile -> symtabs; s != NULL; s = s -> next) - { - bv = BLOCKVECTOR (s); - nbl = BLOCKVECTOR_NBLOCKS (bv); - for (i = 0; i < nbl; i++) - { - b = BLOCKVECTOR_BLOCK (bv, i); - if (BLOCK_SHOULD_SORT (b)) - { - qsort (&BLOCK_SYM (b, 0), BLOCK_NSYMS (b), - sizeof (struct symbol *), compare_symbols); - } - } - } - } -} - - /* add a given stab string into given stab vector. */ static void @@ -2350,7 +2292,7 @@ xcoff_symfile_read (objfile, section_offset, mainline) free_debugsection (); /* Sort symbols alphabetically within each block. */ - sort_syms (); + sort_all_symtab_syms (); /* Install any minimal symbols that have been collected as the current minimal symbols for this objfile. */