]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elf_clone vs ELF_K_AR roland/elf_clone
authorRoland McGrath <roland@redhat.com>
Wed, 16 Jun 2010 03:42:41 +0000 (20:42 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 16 Jun 2010 03:45:14 +0000 (20:45 -0700)
libelf/ChangeLog
libelf/elf_clone.c

index c1479ae4da9b4f4f9c6431804b5f5d1ebdc6c081..3aff0cf7f53d4c1236f424db68cfd41c1ee26bde 100644 (file)
@@ -1,3 +1,7 @@
+2009-08-05  Roland McGrath  <roland@redhat.com>
+
+       * elf_clone.c: Chain onto the ELF->parent->state.ar.children list.
+
 2010-06-14  Ulrich Drepper  <drepper@redhat.com>
 
        * gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit.
index 8b699fa6c0fce4c784e0d948bb429782fdd24fd2..8ed42a600c8ee4d55de66c10dd6af3511cade2f1 100644 (file)
@@ -1,5 +1,5 @@
 /* Create clone of a given descriptor.
-   Copyright (C) 2003, 2004 Red Hat, Inc.
+   Copyright (C) 2003, 2004, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2003.
 
@@ -92,6 +92,14 @@ elf_clone (Elf *elf, Elf_Cmd cmd)
       retval->state.elf32.scns.max = elf->state.elf32.scns.max;
 
       retval->class = elf->class;
+
+      if (retval->parent != NULL)
+       {
+         /* Enlist this new descriptor in the list of children.  */
+         assert (retval->parent->kind == ELF_K_AR);
+         retval->next = retval->parent->state.ar.children;
+         retval->parent->state.ar.children = retval;
+       }
     }
 
   /* Release the lock.  */