I've committed my diff.  However, based on memory of a blog post by
the Solaris ld.so guru and a quick test against Linux,  I expanded the
comment further to explain what a better solution (more like Solaris
and glibc) would involve.  That means anyone with the original diff in
their tree will get a conflict when they "cvs update".  Sorry, but I
wanted to record the info before I forgot it.


On Mon, Jan 18, 2016 at 4:52 AM, Stuart Henderson <[email protected]> wrote:
> There's a small side-effect: with LD_DEBUG, now only the first object
> from the load group is reported as being 'nodelete'.
...
> --- resolve.c,  Mon Jan 18 12:38:27 2016
> +++ resolve.c   Mon Jan 18 12:47:03 2016
> @@ -59,8 +59,12 @@ _dl_add_object(elf_object_t *object)
>          * in needs to be kept around forever, so add a reference there.
>          */
>         if (object->obj_flags & DF_1_NODELETE &&
> -           (object->load_object->status & STAT_NODELETE) == 0) {
> +           (object->status & STAT_NODELETE) == 0) {
> +               object->status |= STAT_NODELETE;
>                 DL_DEB(("objname %s is nodelete\n", object->load_name));
> +       }
> +       if (object->obj_flags & DF_1_NODELETE &&
> +           (object->load_object->status & STAT_NODELETE) == 0) {
>                 object->load_object->opencount++;
>                 object->load_object->status |= STAT_NODELETE;
>         }

Sure.


Philip Guenther

Reply via email to