public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] <shlib-compat.h>: Support compat_symbol_reference for _ISOMAC
@ 2021-03-02 19:30 Florian Weimer
  2021-03-02 20:44 ` H.J. Lu
  2021-03-03  8:39 ` Andreas Schwab
  0 siblings, 2 replies; 13+ messages in thread
From: Florian Weimer @ 2021-03-02 19:30 UTC (permalink / raw)
  To: libc-alpha

This is helpful for testing compat symbols in cases where _ISOMAC
is activated implicitly due to -DMODULE_NAME=testsuite and cannot
be disabled easily.

---
v2: Now actually tested in the situation where I need it.

 include/libc-symbols.h | 28 ++++++++++++++--------------
 include/shlib-compat.h |  2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index ea126ae70c..6e59050da7 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -59,6 +59,19 @@
 # define IN_MODULE (-1)
 #endif
 
+/* Use __symbol_version_reference to specify the version a symbol
+   reference should link to.  Use symbol_version or
+   default_symbol_version for the definition of a versioned symbol.
+   The difference is that the latter is a no-op in non-shared
+   builds.  */
+#ifdef __ASSEMBLER__
+# define __symbol_version_reference(real, name, version) \
+     .symver real, name##@##version
+#else  /* !__ASSEMBLER__ */
+# define __symbol_version_reference(real, name, version) \
+  __asm__ (".symver " #real "," #name "@" #version)
+#endif
+
 #ifndef _ISOMAC
 
 /* This is defined for the compilation of all C library code.  features.h
@@ -396,22 +409,9 @@ for linking")
    past the last element in SET.  */
 #define symbol_set_end_p(set, ptr) ((ptr) >= (void *const *) &__stop_##set)
 
-/* Use symbol_version_reference to specify the version a symbol
-   reference should link to.  Use symbol_version or
-   default_symbol_version for the definition of a versioned symbol.
-   The difference is that the latter is a no-op in non-shared
-   builds.  */
-#ifdef __ASSEMBLER__
-# define symbol_version_reference(real, name, version) \
-     .symver real, name##@##version
-#else  /* !__ASSEMBLER__ */
-# define symbol_version_reference(real, name, version) \
-  __asm__ (".symver " #real "," #name "@" #version)
-#endif
-
 #ifdef SHARED
 # define symbol_version(real, name, version) \
-  symbol_version_reference(real, name, version)
+  __symbol_version_reference(real, name, version)
 # define default_symbol_version(real, name, version) \
      _default_symbol_version(real, name, version)
 # ifdef __ASSEMBLER__
diff --git a/include/shlib-compat.h b/include/shlib-compat.h
index 28baef1ea4..e8adef71bf 100644
--- a/include/shlib-compat.h
+++ b/include/shlib-compat.h
@@ -130,7 +130,7 @@
 #define compat_symbol_reference_1(lib, local, symbol, version) \
   compat_symbol_reference_2 (local, symbol, VERSION_##lib##_##version)
 #define compat_symbol_reference_2(local, symbol, name) \
-  symbol_version_reference (local, symbol, name)
+  __symbol_version_reference (local, symbol, name)
 
 /* Export the symbol only for shared-library compatibility.  */
 #define libc_sunrpc_symbol(name, aliasname, version) \


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-05 13:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 19:30 [PATCH v2] <shlib-compat.h>: Support compat_symbol_reference for _ISOMAC Florian Weimer
2021-03-02 20:44 ` H.J. Lu
2021-03-02 21:02   ` Florian Weimer
2021-03-02 21:18     ` H.J. Lu
2021-03-02 21:23       ` H.J. Lu
2021-03-02 21:28         ` Florian Weimer
2021-03-02 21:33           ` H.J. Lu
2021-03-02 21:35             ` Florian Weimer
2021-03-03 10:04               ` Florian Weimer
2021-03-05 13:06             ` Florian Weimer
2021-03-02 21:26       ` Florian Weimer
2021-03-03  8:39 ` Andreas Schwab
2021-03-03  8:53   ` Florian Weimer

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).