From 6395a1021020671dd205d332b2879e3e733e8024 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 24 Dec 2021 16:04:03 -0800 Subject: ld: Improve thin archive member error message Improve thin archive member error message with: ld: libbar.a(bar.o): error opening thin archive member: No such file or directory instead of ld: libbar.a: error adding symbols: No such file or directory PR ld/28722 * archive.c (_bfd_get_elt_at_filepos): Add a pointer argument for struct bfd_link_info. Call linker callback when failing to open thin archive member. (_bfd_generic_get_elt_at_index): Pass NULL to _bfd_get_elt_at_filepos. (bfd_generic_openr_next_archived_file): Likewise. * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Add a pointer argument for struct bfd_link_info and pass it to _bfd_get_elt_at_filepos. (alpha_ecoff_openr_next_archived_file): Pass NULL to _bfd_get_elt_at_filepos. (alpha_ecoff_get_elt_at_index): Likewise. * coff-rs6000.c (_bfd_xcoff_openr_next_archived_file): Likewise. * ecoff.c (ecoff_link_add_archive_symbols): Pass info to backend->get_elt_at_filepos. * elflink.c (elf_link_is_defined_archive_symbol): info to _bfd_get_elt_at_filepos. * libbfd-in.h (_bfd_get_elt_at_filepos): Add a pointer argument for struct bfd_link_info. * libbfd.h: Regenerate. * libecoff.h (ecoff_backend_data): Add a pointer argument for struct bfd_link_info to get_elt_at_filepos. * linker.c (_bfd_generic_link_add_archive_symbols): Pass info to _bfd_get_elt_at_filepos. --- bfd/ecoff.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bfd/ecoff.c') diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 9132b13..d208105 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -3639,7 +3639,9 @@ ecoff_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) hash = srch; } - element = (*backend->get_elt_at_filepos) (abfd, (file_ptr) file_offset); + element = (*backend->get_elt_at_filepos) (abfd, + (file_ptr) file_offset, + info); if (element == NULL) return false; -- cgit v1.1