aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-08-09 09:27:34 +0000
committerAlan Modra <amodra@gmail.com>2011-08-09 09:27:34 +0000
commit7fe550fc4986f19a766650a76551a4ff4985ef5c (patch)
tree620414b5c8dba6c396e89f504e71ae2dd0bf32be /ld
parent95d048efed6337773c96995e9e74b5563416eaed (diff)
downloadgdb-7fe550fc4986f19a766650a76551a4ff4985ef5c.zip
gdb-7fe550fc4986f19a766650a76551a4ff4985ef5c.tar.gz
gdb-7fe550fc4986f19a766650a76551a4ff4985ef5c.tar.bz2
PR ld/13066
PR ld/12762 * plugin.c (add_symbols): Revert 2011-08-05.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/plugin.c11
2 files changed, 10 insertions, 6 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index bde12e5..e354514 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-09 Alan Modra <amodra@gmail.com>
+
+ PR ld/13066
+ * plugin.c (add_symbols): Revert 2011-08-05.
+
2011-08-06 Kai Tietz <ktietz@redhat.com>
* scripttempl/pep.sc: Add .debug_macro section.
diff --git a/ld/plugin.c b/ld/plugin.c
index 5ba1fca..9baeb46 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -380,11 +380,11 @@ add_symbols (void *handle, int nsyms, const struct ld_plugin_symbol *syms)
{
asymbol **symptrs;
bfd *abfd = handle;
- int n, k;
+ int n;
ASSERT (called_plugin);
symptrs = xmalloc (nsyms * sizeof *symptrs);
- for (n = 0, k = 0; n < nsyms; n++)
+ for (n = 0; n < nsyms; n++)
{
enum ld_plugin_status rv;
asymbol *bfdsym;
@@ -394,16 +394,15 @@ 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;
- if (bfd_section_already_linked (abfd, &linked, &link_info))
- continue;
+ bfd_section_already_linked (abfd, &linked, &link_info);
}
bfdsym = bfd_make_empty_symbol (abfd);
- symptrs[k++] = bfdsym;
+ symptrs[n] = bfdsym;
rv = asymbol_from_plugin_symbol (abfd, bfdsym, syms + n);
if (rv != LDPS_OK)
return rv;
}
- bfd_set_symtab (abfd, symptrs, k);
+ bfd_set_symtab (abfd, symptrs, nsyms);
return LDPS_OK;
}