public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Vivek Das Mohapatra" <vivek@collabora.com>
To: libc-alpha@sourceware.org
Subject: [RFC][PATCH v10 7/7] Restore separate libc loading for the TLS/namespace storage test
Date: Mon, 22 Mar 2021 15:41:11 +0000	[thread overview]
Message-ID: <20210322154111.24798-8-vivek@collabora.com> (raw)
In-Reply-To: <20210322154111.24798-1-vivek@collabora.com>

tst-tls-ie-dlmopen checks to see that new namespaces consume
TLS memory as expected: This does not happen when new namespaces
share the same libc instance (since TLS is allocated only when
a new libc instance insitialises its threading infrastructure).

Adding RTLD_ISOLATE to the dlmopen flags in the test restores
the old behaviour which allows the test to check what it
actually needs to.
---
 elf/tst-tls-ie-dlmopen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elf/tst-tls-ie-dlmopen.c b/elf/tst-tls-ie-dlmopen.c
index a579d72d2d..e67017db2d 100644
--- a/elf/tst-tls-ie-dlmopen.c
+++ b/elf/tst-tls-ie-dlmopen.c
@@ -53,7 +53,7 @@ static void *
 load_and_access (Lmid_t lmid, const char *mod, const char *func)
 {
   /* Load module with TLS.  */
-  void *p = xdlmopen (lmid, mod, RTLD_NOW);
+  void *p = xdlmopen (lmid, mod, RTLD_NOW|RTLD_ISOLATE);
   /* Access the TLS variable to ensure it is allocated.  */
   void (*f) (void) = (void (*) (void))xdlsym (p, func);
   f ();
@@ -95,7 +95,7 @@ do_test (void)
      than 1024 bytes are available (exact number depends on TLS optimizations
      and the libc TLS use).  */
   printf ("The next dlmopen should fail...\n");
-  void *p = dlmopen (LM_ID_BASE, "tst-tls-ie-mod4.so", RTLD_NOW);
+  void *p = dlmopen (LM_ID_BASE, "tst-tls-ie-mod4.so", RTLD_NOW|RTLD_ISOLATE);
   if (p != NULL)
     FAIL_EXIT1 ("error: expected dlmopen to fail because there is "
 		"not enough surplus static TLS.\n");
-- 
2.20.1


  parent reply	other threads:[~2021-03-22 15:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 15:41 [RFC][PATCH v10 0/7] Implementation of RTLD_SHARED for dlmopen Vivek Das Mohapatra
2021-03-22 15:41 ` [RFC][PATCH v10 1/7] Define a new dynamic section tag - DT_GNU_FLAGS_1 (bug 22745) Vivek Das Mohapatra
2021-05-28 14:53   ` Adhemerval Zanella
2021-03-22 15:41 ` [RFC][PATCH v10 2/7] Abstract loaded-DSO search code into a helper function Vivek Das Mohapatra
2021-05-28 14:53   ` Adhemerval Zanella
2021-03-22 15:41 ` [RFC][PATCH v10 3/7] Use the new DSO finder " Vivek Das Mohapatra
2021-05-28 14:53   ` Adhemerval Zanella
2021-03-22 15:41 ` [RFC][PATCH v10 4/7] Add DT_GNU_FLAGS_1/DF_GNU_1_UNIQUE to glibc DSOs (bug 22745) Vivek Das Mohapatra
2021-05-28 14:53   ` Adhemerval Zanella
2021-05-28 16:59     ` Adhemerval Zanella
2021-05-28 17:18     ` Andreas Schwab
2021-03-22 15:41 ` [RFC][PATCH v10 5/7] Implement dlmopen RTLD_SHARED flag " Vivek Das Mohapatra
2021-05-28 17:32   ` Adhemerval Zanella
2021-05-28 18:02     ` Adhemerval Zanella
2021-06-02 15:42       ` Vivek Das Mohapatra
2021-05-28 23:22     ` Vivek Das Mohapatra
2021-03-22 15:41 ` [RFC][PATCH v10 6/7] Add dlmopen / RTLD_SHARED tests Vivek Das Mohapatra
2021-03-22 15:41 ` Vivek Das Mohapatra [this message]
2021-03-25 15:15 ` [RFC][PATCH v10 0/7] Implementation of RTLD_SHARED for dlmopen Vivek Das Mohapatra
2021-04-13 17:02 ` Vivek Das Mohapatra
2021-04-29 15:25   ` Vivek Das Mohapatra
2021-05-11 17:42     ` Vivek Das Mohapatra
2021-05-17 19:08       ` [PING][PATCH " Vivek Das Mohapatra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210322154111.24798-8-vivek@collabora.com \
    --to=vivek@collabora.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).