diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-09-14 16:50:19 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-09-14 16:50:19 +0000 |
commit | 8bff41c1b7ca7abcf4b971ff4f7bf0e83f20477d (patch) | |
tree | 7c6442f7d48640250cd1f85a4b66029e55db7874 /ld/ldmisc.c | |
parent | 1896790ef9595f05c97424f6f7914c0c15d402ea (diff) | |
download | gdb-8bff41c1b7ca7abcf4b971ff4f7bf0e83f20477d.zip gdb-8bff41c1b7ca7abcf4b971ff4f7bf0e83f20477d.tar.gz gdb-8bff41c1b7ca7abcf4b971ff4f7bf0e83f20477d.tar.bz2 |
* ldmisc.c (multiple_warn): Remove; no longer used.
* ldmisc.h (multiple_warn): Don't declare.
Diffstat (limited to 'ld/ldmisc.c')
-rw-r--r-- | ld/ldmisc.c | 70 |
1 files changed, 9 insertions, 61 deletions
diff --git a/ld/ldmisc.c b/ld/ldmisc.c index 4239600..52dee61 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; |