This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR ld/11939: ld segfault in bfd_hash_allocate


We should set unique_global only for ELF hash link table. I
checked it in as an obvious fix.


H.J.
---
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 31e4b4c..a843386 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
 2010-08-25  H.J. Lu  <hongjiu.lu@intel.com>
 
+	PR ld/11939
+	* elflink.c (elf_link_add_object_symbols): Don't set
+	unique_global for non-ELF hash link table.
+
+2010-08-25  H.J. Lu  <hongjiu.lu@intel.com>
+
 	PR ld/11944
 	* elf-bfd.h (elf_backend_data): Add target_id.
 	(bfd_elf_make_generic_object): Renamed to ...
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 2f67c47..28f012c 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -4191,7 +4191,8 @@ error_free_dyn:
 	h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
       *sym_hash = h;
-      h->unique_global = (flags & BSF_GNU_UNIQUE) != 0;
+      if (is_elf_hash_table (htab))
+	h->unique_global = (flags & BSF_GNU_UNIQUE) != 0;
 
       new_weakdef = FALSE;
       if (dynamic


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]