diff options
author | Alan Modra <amodra@gmail.com> | 2005-06-03 09:52:50 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-06-03 09:52:50 +0000 |
commit | e1fffbe6e9081f5d7b12fe6d591b00a8eb6d8897 (patch) | |
tree | 4646ba3ca5d13813ba6c21080270ce790bf545ec /ld/ldmain.c | |
parent | e09f16f93f8ca10018a2dc34fde35758effb6536 (diff) | |
download | gdb-e1fffbe6e9081f5d7b12fe6d591b00a8eb6d8897.zip gdb-e1fffbe6e9081f5d7b12fe6d591b00a8eb6d8897.tar.gz gdb-e1fffbe6e9081f5d7b12fe6d591b00a8eb6d8897.tar.bz2 |
include/
* bfdlink.h (struct bfd_link_callbacks): Add einfo.
bfd/
* configure.in: Bump version
* configure: Regenerate.
* elflink.c (elf_link_input_bfd): Use einfo linker callback to print
discarded section sym refs and kill linker output.
* simple.c (simple_dummy_einfo): New function.
(bfd_simple_get_relocated_section_contents): Init callbacks.einfo.
ld/
* ldmain.c (link_callbacks): Add einfo.
(add_archive_element): Use passed info, not link_info.
(constructor_callback): Likewise.
(reloc_overflow): Don't handle null bfd specially.
(reloc_dangerous, unattached_reloc): Likewise.
* ldmisc.c (vfinfo <B>): Print "ld generated" for null bfd.
(vfinfo <C, D, G>): Handle null bfd. Wrap comments.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r-- | ld/ldmain.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c index a25ceb9..38c92d5 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -160,7 +160,8 @@ static struct bfd_link_callbacks link_callbacks = reloc_overflow, reloc_dangerous, unattached_reloc, - notice + notice, + einfo }; struct bfd_link_info link_info; @@ -873,7 +874,7 @@ add_keepsyms_file (const char *filename) a link. */ static bfd_boolean -add_archive_element (struct bfd_link_info *info ATTRIBUTE_UNUSED, +add_archive_element (struct bfd_link_info *info, bfd *abfd, const char *name) { @@ -904,7 +905,7 @@ add_archive_element (struct bfd_link_info *info ATTRIBUTE_UNUSED, bfd *from; int len; - h = bfd_link_hash_lookup (link_info.hash, name, FALSE, FALSE, TRUE); + h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); if (h == NULL) from = NULL; @@ -1145,7 +1146,7 @@ constructor_callback (struct bfd_link_info *info, /* Ensure that BFD_RELOC_CTOR exists now, so that we can give a useful error message. */ if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL - && (link_info.relocatable + && (info->relocatable || bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL)) einfo (_("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n")); @@ -1422,10 +1423,7 @@ reloc_overflow (struct bfd_link_info *info ATTRIBUTE_UNUSED, if (overflow_cutoff_limit == -1) return TRUE; - if (abfd == NULL) - einfo (_("%P%X: generated")); - else - einfo ("%X%C:", abfd, section, address); + einfo ("%X%C:", abfd, section, address); if (overflow_cutoff_limit >= 0 && overflow_cutoff_limit-- == 0) @@ -1477,11 +1475,8 @@ reloc_dangerous (struct bfd_link_info *info ATTRIBUTE_UNUSED, asection *section, bfd_vma address) { - if (abfd == NULL) - einfo (_("%P%X: generated")); - else - einfo ("%X%C:", abfd, section, address); - einfo (_("dangerous relocation: %s\n"), message); + einfo (_("%X%C: dangerous relocation: %s\n"), + abfd, section, address, message); return TRUE; } @@ -1495,11 +1490,8 @@ unattached_reloc (struct bfd_link_info *info ATTRIBUTE_UNUSED, asection *section, bfd_vma address) { - if (abfd == NULL) - einfo (_("%P%X: generated")); - else - einfo ("%X%C:", abfd, section, address); - einfo (_(" reloc refers to symbol `%T' which is not being output\n"), name); + einfo (_("%X%C: reloc refers to symbol `%T' which is not being output\n"), + abfd, section, address, name); return TRUE; } |