From: Ian Lance Taylor Date: Mon, 6 Feb 1995 23:24:20 +0000 (+0000) Subject: * ldmain.c (undefined_symbol): Handle section being NULL. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=23244cd6e008ff68c41e8a9291b3df0bf76a8843;p=binutils-gdb.git * ldmain.c (undefined_symbol): Handle section being NULL. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 4d3462aed8e..f7be828c7ca 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,7 @@ Mon Feb 6 12:17:24 1995 Ian Lance Taylor + * ldmain.c (undefined_symbol): Handle section being NULL. + * ldctor.c (ldctor_build_sets): Handle bfd_link_hash_defweak. * ldexp.c (fold_name): Likewise. * ldlang.c (print_one_symbol): Likewise. diff --git a/ld/ldmain.c b/ld/ldmain.c index a9b836a70b8..091f776f422 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -833,12 +833,24 @@ undefined_symbol (info, name, abfd, section, address) error_name = buystring (name); } - if (error_count < MAX_ERRORS_IN_A_ROW) - einfo ("%X%C: undefined reference to `%T'\n", - abfd, section, address, name); - else if (error_count == MAX_ERRORS_IN_A_ROW) - einfo ("%D: more undefined references to `%T' follow\n", - abfd, section, address, name); + if (section != NULL) + { + if (error_count < MAX_ERRORS_IN_A_ROW) + einfo ("%X%C: undefined reference to `%T'\n", + abfd, section, address, name); + else if (error_count == MAX_ERRORS_IN_A_ROW) + einfo ("%D: more undefined references to `%T' follow\n", + abfd, section, address, name); + } + else + { + if (error_count < MAX_ERRORS_IN_A_ROW) + einfo ("%X%B: undefined reference to `%T'\n", + abfd, name); + else if (error_count == MAX_ERRORS_IN_A_ROW) + einfo ("%B: more undefined references to `%T' follow\n", + abfd, name); + } return true; }