public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: libc-alpha@sourceware.org
Subject: [PATCH 13/14] dlfcn: Eliminate GLIBC_PRIVATE dependency from tststatic2
Date: Wed, 19 May 2021 20:05:20 +0200	[thread overview]
Message-ID: <4099ccd0d163c2064cb126632bfa2933732592d6.1621446837.git.fweimer@redhat.com> (raw)
In-Reply-To: <cover.1621446837.git.fweimer@redhat.com>

The test appears to use _dlfcn_hook@@GLIBC_PRIVATE as a way to
test dlvsym without having to know the appropriate symbol version.
With <first-versions.h>, we can use a public symbol and the symbol
version at which it was defined first.
---
 dlfcn/modstatic2.c | 3 ++-
 dlfcn/tststatic2.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlfcn/modstatic2.c b/dlfcn/modstatic2.c
index 9b5aae8b9f..34568d4e6e 100644
--- a/dlfcn/modstatic2.c
+++ b/dlfcn/modstatic2.c
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <gnu/lib-names.h>
+#include <first-versions.h>
 
 int test (FILE *out, int a);
 
@@ -117,7 +118,7 @@ test (FILE *out, int a)
       exit (1);
     }
 
-  if (dlvsym (handle2, "_dlfcn_hook", "GLIBC_PRIVATE") == NULL)
+  if (dlvsym (handle2, "malloc", FIRST_VERSION_libc_malloc_STRING) == NULL)
     {
       fprintf (out, "dlvsym: %s\n", dlerror ());
       exit (1);
diff --git a/dlfcn/tststatic2.c b/dlfcn/tststatic2.c
index f8cd5a964b..ba4648e521 100644
--- a/dlfcn/tststatic2.c
+++ b/dlfcn/tststatic2.c
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <gnu/lib-names.h>
+#include <first-versions.h>
 
 static int
 do_test (void)
@@ -115,7 +116,7 @@ do_test (void)
       exit (1);
     }
 
-  if (dlvsym (handle2, "_dlfcn_hook", "GLIBC_PRIVATE") == NULL)
+  if (dlvsym (handle2, "malloc", FIRST_VERSION_libc_malloc_STRING) == NULL)
     {
       printf ("dlvsym: %s\n", dlerror ());
       exit (1);
-- 
2.31.1



  parent reply	other threads:[~2021-05-19 18:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 18:03 [PATCH 00/14] Move libdl into libc Florian Weimer
2021-05-19 18:04 ` [PATCH 01/14] stdio-common: Remove _IO_vfwscanf Florian Weimer
2021-05-19 18:04 ` [PATCH 02/14] Add libc ABI extension kludge for baseline-violating libdl symbols Florian Weimer
2021-05-19 18:04 ` [PATCH 03/14] dlfcn: Move dlerror into libc Florian Weimer
2021-05-19 18:04 ` [PATCH 04/14] dlfcn: Move dlclose " Florian Weimer
2021-05-19 18:04 ` [PATCH 05/14] dlfcn: Move dladdr " Florian Weimer
2021-05-19 18:04 ` [PATCH 06/14] dlfcn: Move dlsym " Florian Weimer
2021-05-19 18:04 ` [PATCH 07/14] dlfcn: Move dlmopen " Florian Weimer
2021-05-19 18:04 ` [PATCH 08/14] dlfcn: Move dladdr1 " Florian Weimer
2021-05-19 18:04 ` [PATCH 09/14] dlfcn: Move dlinfo " Florian Weimer
2021-05-19 18:05 ` [PATCH 10/14] dlfcn: Move dlvsym " Florian Weimer
2021-05-19 18:05 ` [PATCH 11/14] dlfcn: Move dlopen " Florian Weimer
2021-05-19 18:05 ` [PATCH 12/14] dlfcn: Cleanups after -ldl is no longer required Florian Weimer
2021-05-19 18:05 ` Florian Weimer [this message]
2021-05-19 18:05 ` [PATCH 14/14] dlfcn: Rework static dlopen hooks Florian Weimer
2021-05-21 19:17 ` [PATCH 00/14] Move libdl into libc Florian Weimer
2021-05-22 17:16   ` Florian Weimer
2021-05-25 14:44 [PATCH v2 " Florian Weimer
2021-05-25 14:46 ` [PATCH 13/14] dlfcn: Eliminate GLIBC_PRIVATE dependency from tststatic2 Florian Weimer
2021-05-25 15:38   ` Andreas Schwab
2021-05-25 15:42     ` Florian Weimer
2021-05-25 15:54       ` Andreas Schwab
2021-05-25 15:56         ` Florian Weimer
2021-05-25 16:45           ` Andreas Schwab

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=4099ccd0d163c2064cb126632bfa2933732592d6.1621446837.git.fweimer@redhat.com \
    --to=fweimer@redhat.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).