X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Fldmain.c;h=ba2a5923e3e64442366fdaad94c270efc2a0878b;hb=aea4bd9d34f1b7454f9f04081569e7fe8371fca7;hp=1e710dbb6504cfe0937dd3c8bb294285a47ffaee;hpb=5b64ad42d36e6d487e1f7287d37fbc243a178e72;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/ldmain.c b/ld/ldmain.c index 1e710dbb65..ba2a5923e3 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -117,7 +117,7 @@ static boolean warning_callback PARAMS ((struct bfd_link_info *, static void warning_find_reloc PARAMS ((bfd *, asection *, PTR)); static boolean undefined_symbol PARAMS ((struct bfd_link_info *, const char *, bfd *, - asection *, bfd_vma)); + asection *, bfd_vma, boolean)); static boolean reloc_overflow PARAMS ((struct bfd_link_info *, const char *, const char *, bfd_vma, bfd *, asection *, bfd_vma)); @@ -231,7 +231,11 @@ main (argc, argv) link_info.notice_hash = NULL; link_info.wrap_hash = NULL; link_info.mpc860c0 = 0; - + /* SVR4 linkers seem to set DT_INIT and DT_FINI based on magic _init + and _fini symbols. We are compatible. */ + link_info.init_function = "_init"; + link_info.fini_function = "_fini"; + ldfile_add_arch (""); config.make_executable = true; @@ -701,7 +705,7 @@ add_keepsyms_file (filename) /*ARGSUSED*/ static boolean add_archive_element (info, abfd, name) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; bfd *abfd; const char *name; { @@ -816,7 +820,7 @@ add_archive_element (info, abfd, name) /*ARGSUSED*/ static boolean multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; bfd *obfd; asection *osec; @@ -853,7 +857,7 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) /*ARGSUSED*/ static boolean multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; bfd *obfd; enum bfd_link_hash_type otype; @@ -920,7 +924,7 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize) /*ARGSUSED*/ static boolean add_to_set (info, h, reloc, abfd, section, value) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_hash_entry *h; bfd_reloc_code_real_type reloc; bfd *abfd; @@ -1019,7 +1023,7 @@ struct warning_callback_info /*ARGSUSED*/ static boolean warning_callback (info, warning, symbol, abfd, section, address) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *warning; const char *symbol; bfd *abfd; @@ -1140,12 +1144,13 @@ warning_find_reloc (abfd, sec, iarg) /*ARGSUSED*/ static boolean -undefined_symbol (info, name, abfd, section, address) - struct bfd_link_info *info; +undefined_symbol (info, name, abfd, section, address, fatal) + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; bfd *abfd; asection *section; bfd_vma address; + boolean fatal; { static char *error_name; static unsigned int error_count; @@ -1189,8 +1194,12 @@ undefined_symbol (info, name, abfd, section, address) if (section != NULL) { if (error_count < MAX_ERRORS_IN_A_ROW) - einfo (_("%X%C: undefined reference to `%T'\n"), - abfd, section, address, name); + { + einfo (_("%C: undefined reference to `%T'\n"), + abfd, section, address, name); + if (fatal) + einfo ("%X"); + } else if (error_count == MAX_ERRORS_IN_A_ROW) einfo (_("%D: more undefined references to `%T' follow\n"), abfd, section, address, name); @@ -1198,8 +1207,12 @@ undefined_symbol (info, name, abfd, section, address) else { if (error_count < MAX_ERRORS_IN_A_ROW) - einfo (_("%X%B: undefined reference to `%T'\n"), - abfd, name); + { + einfo (_("%B: undefined reference to `%T'\n"), + abfd, name); + if (fatal) + einfo ("%X"); + } else if (error_count == MAX_ERRORS_IN_A_ROW) einfo (_("%B: more undefined references to `%T' follow\n"), abfd, name); @@ -1213,7 +1226,7 @@ undefined_symbol (info, name, abfd, section, address) /*ARGSUSED*/ static boolean reloc_overflow (info, name, reloc_name, addend, abfd, section, address) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; const char *reloc_name; bfd_vma addend; @@ -1237,7 +1250,7 @@ reloc_overflow (info, name, reloc_name, addend, abfd, section, address) /*ARGSUSED*/ static boolean reloc_dangerous (info, message, abfd, section, address) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *message; bfd *abfd; asection *section; @@ -1257,7 +1270,7 @@ reloc_dangerous (info, message, abfd, section, address) /*ARGSUSED*/ static boolean unattached_reloc (info, name, abfd, section, address) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; bfd *abfd; asection *section;