* elflink.h (elf_link_add_object_symbols): Don't bfd_release runpath.
authorAlan Modra <amodra@gmail.com>
Fri, 29 Sep 2000 13:15:03 +0000 (13:15 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 29 Sep 2000 13:15:03 +0000 (13:15 +0000)
bfd/ChangeLog
bfd/elflink.h

index 1f81b532c2c6c41c4556a1759bd08ad657194f8b..b454dc841b01030e50e9e5db5a7db1f6b6bd37d8 100644 (file)
@@ -1,3 +1,7 @@
+2000-09-29  NIIBE Yutaka <gniibe@chroot.org>
+
+       * elflink.h (elf_link_add_object_symbols): Don't bfd_release runpath.
+
 2000-09-29  Momchil Velikov <velco@fadata.bg>
 
        * elf.c (elf_fake_sections): Do not mark the section SHT_NOBITS if
index a808673d6ece4706e7350096acf7e606b3be0195..80c5b1c8fdec51bb245fd5344fd9200cc3211f36 100644 (file)
@@ -1191,19 +1191,11 @@ elf_link_add_object_symbols (abfd, info)
                  char *fnm, *anm;
 
                  /* When we see DT_RPATH before DT_RUNPATH, we have
-                    to free runpath. */
+                    to clear runpath.  Do _NOT_ bfd_release, as that
+                    frees all more recently bfd_alloc'd blocks as
+                    well.  */
                  if (rpath && elf_hash_table (info)->runpath)
-                   {
-                     struct bfd_link_needed_list *nn;
-                     for (n = elf_hash_table (info)->runpath;
-                          n != NULL; n = nn)
-                       {
-                         nn = n->next;
-                         bfd_release (abfd, n);
-                       }
-                     bfd_release (abfd, elf_hash_table (info)->runpath);
-                     elf_hash_table (info)->runpath = NULL;
-                   }
+                   elf_hash_table (info)->runpath = NULL;
 
                  n = ((struct bfd_link_needed_list *)
                       bfd_alloc (abfd, sizeof (struct bfd_link_needed_list)));