aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-08-05 03:17:12 +0000
committerAlan Modra <amodra@gmail.com>2011-08-05 03:17:12 +0000
commit43e1669b2d187f4b2e4ecdf98a5aac8e9fb10bfd (patch)
tree68647f2f6ce1d2294bd05d4e4ca671d5943b6eee /ld
parent6177242a84b9139f50d23a2b86ac68da6183e10c (diff)
downloadgdb-43e1669b2d187f4b2e4ecdf98a5aac8e9fb10bfd.zip
gdb-43e1669b2d187f4b2e4ecdf98a5aac8e9fb10bfd.tar.gz
gdb-43e1669b2d187f4b2e4ecdf98a5aac8e9fb10bfd.tar.bz2
PR ld/12762
bfd/ * elflink.c (_bfd_elf_section_already_linked): Return matched status. Remove COFF comdat section handling. * linker.c (_bfd_generic_section_already_linked): Return matched status. Don't set SEC_GROUP in l_flags for plugin entries. (bfd_section_already_linked): Update prototype. * targets.c (_section_already_linked): Likewise. * elf-bfd.h (_bfd_elf_section_already_linked): Likewise. * libbfd-in.h (_bfd_generic_section_already_linked): Likewise. (_bfd_nolink_section_already_linked): Update. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. ld/ * plugin.c (add_symbols): Exclude comdat_key symbols from symbol table if already seen.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/plugin.c12
2 files changed, 13 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 2b217b5..bb23c7a 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-05 Alan Modra <amodra@gmail.com>
+
+ PR ld/12762
+ * plugin.c (add_symbols): Exclude comdat_key symbols from symbol
+ table if already seen.
+
2011-08-04 H.J. Lu <hongjiu.lu@intel.com>
* ldmain.c (main): Replace remove_output with ld_cleanup in
diff --git a/ld/plugin.c b/ld/plugin.c
index 0a0ee0c..5ba1fca 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -380,10 +380,11 @@ add_symbols (void *handle, int nsyms, const struct ld_plugin_symbol *syms)
{
asymbol **symptrs;
bfd *abfd = handle;
- int n;
+ int n, k;
+
ASSERT (called_plugin);
symptrs = xmalloc (nsyms * sizeof *symptrs);
- for (n = 0; n < nsyms; n++)
+ for (n = 0, k = 0; n < nsyms; n++)
{
enum ld_plugin_status rv;
asymbol *bfdsym;
@@ -393,15 +394,16 @@ add_symbols (void *handle, int nsyms, const struct ld_plugin_symbol *syms)
struct already_linked linked;
linked.comdat_key = xstrdup (syms[n].comdat_key);
linked.u.abfd = abfd;
- bfd_section_already_linked (abfd, &linked, &link_info);
+ if (bfd_section_already_linked (abfd, &linked, &link_info))
+ continue;
}
bfdsym = bfd_make_empty_symbol (abfd);
- symptrs[n] = bfdsym;
+ symptrs[k++] = bfdsym;
rv = asymbol_from_plugin_symbol (abfd, bfdsym, syms + n);
if (rv != LDPS_OK)
return rv;
}
- bfd_set_symtab (abfd, symptrs, nsyms);
+ bfd_set_symtab (abfd, symptrs, k);
return LDPS_OK;
}