From: H.J. Lu Date: Thu, 15 Sep 2011 16:03:03 +0000 (+0000) Subject: Support thin archive member for LTO. X-Git-Tag: binutils-2_22-branchpoint~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b7e430865a5b95563993e327ef0e9f5f0ac81d2;p=platform%2Fupstream%2Fbinutils.git Support thin archive member for LTO. 2011-09-15 Dmitry Gorbachev PR ld/13183 * ldmain.c (add_archive_element): Support thin archive member for LTO. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index e7a639c..99ef7b1 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2011-09-15 Dmitry Gorbachev + + PR ld/13183 + * ldmain.c (add_archive_element): Support thin archive member + for LTO. + 2011-08-26 Nick Clifton * po/es.po: Updated Spanish translation. diff --git a/ld/ldmain.c b/ld/ldmain.c index 567b697..3c0dbc4 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -808,12 +808,12 @@ add_archive_element (struct bfd_link_info *info, BFD, but we still want to output the original BFD filename. */ orig_input = *input; #ifdef ENABLE_PLUGINS - if (bfd_my_archive (abfd) != NULL - && plugin_active_plugins_p () - && !no_more_claiming) + if (plugin_active_plugins_p () && !no_more_claiming) { /* We must offer this archive member to the plugins to claim. */ - int fd = open (bfd_my_archive (abfd)->filename, O_RDONLY | O_BINARY); + const char *filename = (bfd_my_archive (abfd) != NULL + ? bfd_my_archive (abfd)->filename : abfd->filename); + int fd = open (filename, O_RDONLY | O_BINARY); if (fd >= 0) { struct ld_plugin_input_file file; @@ -822,7 +822,7 @@ add_archive_element (struct bfd_link_info *info, member, not the whole file, and must exclude the header. Fortunately for us, that is how the data is stored in the origin field of the bfd and in the arelt_data. */ - file.name = bfd_my_archive (abfd)->filename; + file.name = filename; file.offset = abfd->origin; file.filesize = arelt_size (abfd); file.fd = fd;