diff options
author | Roland McGrath <roland@redhat.com> | 2010-06-15 20:42:41 -0700 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2010-06-15 20:45:14 -0700 |
commit | 4f703e07434fb0f123eba1dfa412ed4b8535421d (patch) | |
tree | 99f7cac0410f4a0fd502de57e26697023007be47 | |
parent | a92f1a4edebaaed1878dd5135b67afeb52fc7d0a (diff) |
elf_clone vs ELF_K_ARupstream/roland/elf_clone
-rw-r--r-- | libelf/ChangeLog | 4 | ||||
-rw-r--r-- | libelf/elf_clone.c | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog index c1479ae4..3aff0cf7 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -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. diff --git a/libelf/elf_clone.c b/libelf/elf_clone.c index 8b699fa6..8ed42a60 100644 --- a/libelf/elf_clone.c +++ b/libelf/elf_clone.c @@ -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. */ |