summaryrefslogtreecommitdiff
path: root/ld/ldmain.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-09-15 16:03:02 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-09-15 16:03:02 +0000
commit7429c616ce1b885fb1817bf2d6544edb444cdb96 (patch)
treec9505e26cdc47dfed90f7f70eeeab2884ac8aea7 /ld/ldmain.c
parente7b8c717192424b2f0bd39cf5a3e9de0c6559f28 (diff)
downloadbinutils-redhat-7429c616ce1b885fb1817bf2d6544edb444cdb96.tar.gz
Support thin archive member for LTO.
2011-09-15 Dmitry Gorbachev <d.g.gorbachev@gmail.com> PR ld/13183 * ldmain.c (add_archive_element): Support thin archive member for LTO.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r--ld/ldmain.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 567b6979e1..3c0dbc4d44 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;