summaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-07-09 06:20:50 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-07-09 06:20:50 +0000
commit8b6ed5b4da2a02a7cefa7db05e99cce952cbcd54 (patch)
tree29a14707e131d7128178d0be688b220141793dda /ld/ldlang.c
parentfc7f3baefcef476346897d0c9cab72601221b7f3 (diff)
downloadbinutils-redhat-8b6ed5b4da2a02a7cefa7db05e99cce952cbcd54.tar.gz
PR ld/12942
bfd/ * elflink.c (elf_link_add_object_symbols): Use elf_discarded_section rather than kept_section to determine whether a symbol is from a discarded section. * cofflink.c (coff_link_add_symbols): Make symbols from discarded sections appear undefined. * elf-bfd.h (_bfd_elf_section_already_linked): Replace "asection *" with "struct already_linked *". * libbfd-in.h (_bfd_nolink_section_already_linked): Likewise. (_bfd_generic_section_already_linked): Likewise. (bfd_section_already_linked_table_insert): Likewise. (struct already_linked): New. (struct bfd_section_already_linked): Use it. * elflink.c (_bfd_elf_section_already_linked): Replace. "asection *" with "struct already_linked *". Replace the plugin dummy with the LTO output. * linker.c (_bfd_generic_section_already_linked): Likewise. * targets.c (struct already_linked): Add forward declaration. (bfd_target): Replace "struct bfd_section *" with "struct already_linked *" in _section_already_linked. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. include/ * bfdlink.h (bfd_link_info): Add loading_lto_outputs. ld/ * ldlang.c (section_already_linked): Pass "struct already_linked *" to bfd_section_already_linked. (lang_process): Set link_info.loading_lto_outputs before loading LTO outputs. * plugin.c: Include "libbfd.h". (add_symbols): Call bfd_section_already_linked with comdat_key.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 7e06613b51..860ce27b30 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -2237,7 +2237,12 @@ section_already_linked (bfd *abfd, asection *sec, void *data)
}
if (!(abfd->flags & DYNAMIC))
- bfd_section_already_linked (abfd, sec, &link_info);
+ {
+ struct already_linked linked;
+ linked.comdat_key = NULL;
+ linked.u.sec = sec;
+ bfd_section_already_linked (abfd, &linked, &link_info);
+ }
}
/* The wild routines.
@@ -6544,6 +6549,7 @@ lang_process (void)
einfo (_("%P%F: %s: plugin reported error after all symbols read\n"),
plugin_error_plugin ());
/* Open any newly added files, updating the file chains. */
+ link_info.loading_lto_outputs = TRUE;
open_input_bfds (added.head, OPEN_BFD_NORMAL);
/* Restore the global list pointer now they have all been added. */
lang_list_remove_tail (stat_ptr, &added);