From 8bff41c1b7ca7abcf4b971ff4f7bf0e83f20477d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 14 Sep 1994 16:50:19 +0000 Subject: [PATCH] * ldmisc.c (multiple_warn): Remove; no longer used. * ldmisc.h (multiple_warn): Don't declare. --- ld/ChangeLog | 5 ++++ ld/ldmisc.c | 70 +++++++--------------------------------------------- 2 files changed, 14 insertions(+), 61 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 00294c87bbe..ae176da2667 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 14 12:48:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * ldmisc.c (multiple_warn): Remove; no longer used. + * ldmisc.h (multiple_warn): Don't declare. + Tue Sep 13 20:47:58 1994 Steve Chamberlain (sac@jonny.cygnus.com) * ldlang.c (print_output_section_statement): Print all lines diff --git a/ld/ldmisc.c b/ld/ldmisc.c index 4239600adc2..52dee619a3c 100644 --- a/ld/ldmisc.c +++ b/ld/ldmisc.c @@ -28,6 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "ldmisc.h" #include "ldexp.h" #include "ldlang.h" +#include "ldgram.h" #include "ldlex.h" #include "ldmain.h" #include "ldfile.h" @@ -188,10 +189,7 @@ vfinfo(fp, fmt, arg) case 'S': /* print script file and linenumber */ { - if (ldfile_input_filename == (char *)NULL) { - fprintf(fp,"command line"); - } - else { + if (ldfile_input_filename) { fprintf(fp,"%s:%u", ldfile_input_filename, lineno ); } } @@ -233,12 +231,16 @@ vfinfo(fp, fmt, arg) asymbols = entry->asymbols; else { - unsigned int symsize; - unsigned int symbol_count; + long symsize; + long symbol_count; - symsize = get_symtab_upper_bound (abfd); + symsize = bfd_get_symtab_upper_bound (abfd); + if (symsize < 0) + einfo ("%B%F: could not read symbols", abfd); asymbols = (asymbol **) xmalloc (symsize); symbol_count = bfd_canonicalize_symtab (abfd, asymbols); + if (symbol_count < 0) + einfo ("%B%F: could not read symbols", abfd); if (entry != (lang_input_statement_type *) NULL) { entry->asymbols = asymbols; @@ -312,35 +314,6 @@ void einfo(va_alist) va_end(arg); } -/* Warn about a symbol NEWSYM being multiply defined with another symbol OLDSYM. - MESSAGE1 and MESSAGE2 should look something like: - "%C: warning: multiple commons of `%s'\n" - "%C: warning: previous common here\n" */ - -void -multiple_warn (message1, newsym, message2, oldsym) - char *message1; - asymbol *newsym; - char *message2; - asymbol *oldsym; -{ - lang_input_statement_type *inp_stat; - asymbol **stat_symbols; - - inp_stat = (lang_input_statement_type *) bfd_asymbol_bfd (newsym)->usrdata; - stat_symbols = inp_stat ? inp_stat->asymbols : 0; - - einfo (message1, - bfd_asymbol_bfd (newsym), newsym->section, stat_symbols, newsym->value, - demangle (newsym->name, 1)); - - inp_stat = (lang_input_statement_type *) bfd_asymbol_bfd (oldsym)->usrdata; - stat_symbols = inp_stat ? inp_stat->asymbols : 0; - - einfo (message2, - bfd_asymbol_bfd (oldsym), oldsym->section, stat_symbols, oldsym->value); -} - void info_assert(file, line) char *file; @@ -349,31 +322,6 @@ info_assert(file, line) einfo("%F%P: internal error %s %d\n", file,line); } -/* Return a newly-allocated string - whose contents concatenate those of S1, S2, S3. */ - -char * -concat (s1, s2, s3) - CONST char *s1; - CONST char *s2; - CONST char *s3; -{ - size_t len1 = strlen (s1); - size_t len2 = strlen (s2); - size_t len3 = strlen (s3); - char *result = xmalloc (len1 + len2 + len3 + 1); - - if (len1 != 0) - memcpy(result, s1, len1); - if (len2 != 0) - memcpy(result+len1, s2, len2); - if (len3 != 0) - memcpy(result+len1+len2, s2, len3); - *(result + len1 + len2 + len3) = 0; - - return result; -} - char * buystring (x) CONST char *CONST x; -- 2.30.2