diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-04-26 22:15:10 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-04-26 22:15:10 +0000 |
commit | efa6c49704b5d4a46840c7d93f1312010ad2bae4 (patch) | |
tree | e01dc1a4e85f0798e2a695e127744af92f355ff6 /ld/ldmain.c | |
parent | ecba7a3a1aa79f341f0b1574e05e634a617247e5 (diff) | |
download | gdb-efa6c49704b5d4a46840c7d93f1312010ad2bae4.zip gdb-efa6c49704b5d4a46840c7d93f1312010ad2bae4.tar.gz gdb-efa6c49704b5d4a46840c7d93f1312010ad2bae4.tar.bz2 |
* ldmisc.h (demangle): Declare.
* ldmisc.c: Include "libiberty.h". Include demangle.h with "",
not <>.
(demangle): Make non-static. Remove remove_underscore paramter.
Always return an allocated string.
(vfinfo): Free result of demangle. Add case 'G'. Use %T to print
functionname, rather than calling demangle. Print a colon between
the BFD(section+offset) and the line number.
* ldmain.c (add_archive_element): Improve format of archive
information in map file.
(constructor_callback): Don't print anything to the map file.
* ldlang.c (lang_one_common): Improve format of common symbol
information in map file.
* ldctor.c (ldctor_build_sets): If producing a map file, print set
information.
* ldwrite.c (print_symbol_table): Print a newline before the
header in the map file.
* Makefile.in: Rebuild dependencies.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r-- | ld/ldmain.c | 81 |
1 files changed, 76 insertions, 5 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c index aee02e7..d637a50 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -637,7 +637,82 @@ add_archive_element (info, abfd, name) ldlang_add_file (input); if (config.map_file != (FILE *) NULL) - minfo ("%s needed due to %T\n", abfd->filename, name); + { + static boolean header_printed; + struct bfd_link_hash_entry *h; + bfd *from; + int len; + + h = bfd_link_hash_lookup (link_info.hash, name, false, false, true); + + if (h == NULL) + from = NULL; + else + { + switch (h->type) + { + default: + from = NULL; + break; + + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + from = h->u.def.section->owner; + break; + + case bfd_link_hash_undefined: + case bfd_link_hash_undefweak: + from = h->u.undef.abfd; + break; + + case bfd_link_hash_common: + from = h->u.c.p->section->owner; + break; + } + } + + if (! header_printed) + { + char buf[100]; + + sprintf (buf, "%-29s %s\n\n", "Archive member included", + "because of file (symbol)"); + minfo ("%s", buf); + header_printed = true; + } + + if (bfd_my_archive (abfd) == NULL) + { + minfo ("%s", bfd_get_filename (abfd)); + len = strlen (bfd_get_filename (abfd)); + } + else + { + minfo ("%s(%s)", bfd_get_filename (bfd_my_archive (abfd)), + bfd_get_filename (abfd)); + len = (strlen (bfd_get_filename (bfd_my_archive (abfd))) + + strlen (bfd_get_filename (abfd)) + + 2); + } + + if (len >= 29) + { + print_nl (); + len = 0; + } + while (len < 30) + { + print_space (); + ++len; + } + + if (from != NULL) + minfo ("%B ", from); + if (h != NULL) + minfo ("(%T)\n", h->root.string); + else + minfo ("(%s)\n", name); + } if (trace_files || trace_file_tries) info_msg ("%I\n", input); @@ -820,10 +895,6 @@ constructor_callback (info, constructor, name, abfd, section, value) else strcpy (s, "__DTOR_LIST__"); - if (config.map_file != (FILE *) NULL) - fprintf (config.map_file, - "Adding %s to constructor/destructor set %s\n", name, set_name); - h = bfd_link_hash_lookup (info->hash, set_name, true, true, true); if (h == (struct bfd_link_hash_entry *) NULL) einfo ("%P%F: bfd_link_hash_lookup failed: %E\n"); |