diff mbox

Set NODELETE flag when opening already open objects with RTLD_NODELETE

Message ID 20150716050936.GQ29227@spoyarek.pnq.redhat.com
State New
Headers show

Commit Message

Siddhesh Poyarekar July 16, 2015, 5:09 a.m. UTC
On Thu, Jul 16, 2015 at 01:01:31AM -0400, Carlos O'Donell wrote:
> > +  dlclose (h1);
> > +  dlclose (h2);
> 
> How does the test verify the object was not unloaded?

The *foo dereference will crash if the object was unloaded.  I have
added a comment that says this and pushed it as obvious.

> Post v2?

I already committed it!

Siddhesh

commit e591758b38a606f6197cfdd0f8382fa8397b5e77
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Jul 16 10:38:29 2015 +0530

    Add comment to clarify how the test can fail

Comments

Carlos O'Donell July 16, 2015, 5:44 a.m. UTC | #1
On 07/16/2015 01:09 AM, Siddhesh Poyarekar wrote:
> On Thu, Jul 16, 2015 at 01:01:31AM -0400, Carlos O'Donell wrote:
>>> +  dlclose (h1);
>>> +  dlclose (h2);
>>
>> How does the test verify the object was not unloaded?
> 
> The *foo dereference will crash if the object was unloaded.  I have
> added a comment that says this and pushed it as obvious.
> 
>> Post v2?
> 
> I already committed it!

Thanks. Looks good to me.

c.
diff mbox

Patch

diff --git a/ChangeLog b/ChangeLog
index 665f5cc..34b3128 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@ 
 2015-07-16  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+	* tst-nodelete-opened.c (do_test): Add comment to clarify how
+	the test can fail.
+
 	* stdlib/cxa_thread_atexit_impl.c: Whitespace fixup.
 
 	[BZ #18676]
diff --git a/elf/tst-nodelete-opened.c b/elf/tst-nodelete-opened.c
index 43b00fa..501d005 100644
--- a/elf/tst-nodelete-opened.c
+++ b/elf/tst-nodelete-opened.c
@@ -58,6 +58,8 @@  do_test (void)
       return 1;
     }
 
+  /* This FOO dereference will crash with a segfault if the DSO was
+     unloaded.  */
   printf ("foo == %d\n", *foo);
 
   return 0;