aboutsummaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index 60eb102..0a0ee0c 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -32,6 +32,7 @@
#include "plugin.h"
#include "plugin-api.h"
#include "elf-bfd.h"
+#include "libbfd.h"
#if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H)
#include <windows.h>
#endif
@@ -385,7 +386,16 @@ add_symbols (void *handle, int nsyms, const struct ld_plugin_symbol *syms)
for (n = 0; n < nsyms; n++)
{
enum ld_plugin_status rv;
- asymbol *bfdsym = bfd_make_empty_symbol (abfd);
+ asymbol *bfdsym;
+
+ if (syms[n].comdat_key)
+ {
+ struct already_linked linked;
+ linked.comdat_key = xstrdup (syms[n].comdat_key);
+ linked.u.abfd = abfd;
+ bfd_section_already_linked (abfd, &linked, &link_info);
+ }
+ bfdsym = bfd_make_empty_symbol (abfd);
symptrs[n] = bfdsym;
rv = asymbol_from_plugin_symbol (abfd, bfdsym, syms + n);
if (rv != LDPS_OK)