public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Fangrui Song <maskray@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] libc-symbols.h: remove unused macros Date: Tue, 5 Jul 2022 04:15:52 +0000 (GMT) [thread overview] Message-ID: <20220705041552.AEBE6385828E@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=62595e89447c09fe4e34cd9fc1d4cf1b7f3ecb33 commit 62595e89447c09fe4e34cd9fc1d4cf1b7f3ecb33 Author: Fangrui Song <maskray@google.com> Date: Mon Jul 4 21:15:51 2022 -0700 libc-symbols.h: remove unused macros Beside weak_hidden_alias/declare_symbol_alias/hidden_data_ver, many *_hidden_* macros are removed. If there is a rare need to use one, one may write something like `#if IS_IN (libm)\nhidden_def (...)\n#endif` instead. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Diff: --- include/libc-symbols.h | 169 ------------------------------------------------- 1 file changed, 169 deletions(-) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 4fde839471..f4437ff6ad 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -155,14 +155,6 @@ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) \ __attribute_copy__ (name); -/* Same as WEAK_ALIAS, but mark symbol as hidden. */ -# define weak_hidden_alias(name, aliasname) \ - _weak_hidden_alias (name, aliasname) -# define _weak_hidden_alias(name, aliasname) \ - extern __typeof (name) aliasname \ - __attribute__ ((weak, alias (#name), __visibility__ ("hidden"))) \ - __attribute_copy__ (name); - /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */ # define weak_extern(symbol) _weak_extern (weak symbol) # define _weak_extern(expr) _Pragma (#expr) @@ -332,14 +324,6 @@ for linking") .type C_SYMBOL_NAME (symbol), %object ASM_LINE_SEP \ .size C_SYMBOL_NAME (symbol), s_size ASM_LINE_SEP #else /* Not __ASSEMBLER__. */ -# define declare_symbol_alias(symbol, original, type, size) \ - declare_symbol_alias_1 (symbol, original, type, size) -# define declare_symbol_alias_1(symbol, original, type, size) \ - asm (".globl " __SYMBOL_PREFIX #symbol \ - "\n\t" declare_symbol_alias_1_alias (symbol, original) \ - "\n\t.type " __SYMBOL_PREFIX #symbol ", " \ - "%" #type \ - "\n\t.size " __SYMBOL_PREFIX #symbol ", " #size); # ifdef HAVE_ASM_SET_DIRECTIVE # define declare_symbol_alias_1_alias(symbol, original) \ ".set " __SYMBOL_PREFIX #symbol ", " __SYMBOL_PREFIX #original @@ -556,7 +540,6 @@ for linking") __attribute__((alias (__hidden_asmname (#local)))) \ __attribute_copy__ (name) # define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name); -# define hidden_data_ver(local, name) hidden_ver(local, name) # define hidden_def(name) __hidden_ver1(__GI_##name, name, name); # define hidden_def_alias(name, internal) \ strong_alias (name, internal) @@ -595,7 +578,6 @@ for linking") # define hidden_data_def_alias(name, alias) strong_data_alias (name, alias) # define hidden_tls_def(name) hidden_data_def (name) # define hidden_data_weak(name) hidden_data_def (name) -# define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name) # define HIDDEN_JUMPTARGET(name) __GI_##name # endif #else @@ -631,7 +613,6 @@ for linking") # define hidden_data_def(name) # define hidden_data_def_alias(name, alias) # define hidden_tls_def(name) -# define hidden_data_ver(local, name) # define hidden_nolink(name, lib, version) #endif @@ -641,7 +622,6 @@ for linking") hidden_proto_alias (name, alias, ##attrs) # define libc_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define libc_hidden_def(name) hidden_def (name) -# define libc_hidden_def_alias(name, alias) hidden_def_alias (name, alias) # define libc_hidden_weak(name) hidden_weak (name) # define libc_hidden_nolink_sunrpc(name, version) hidden_nolink (name, libc, version) # define libc_hidden_ver(local, name) hidden_ver (local, name) @@ -649,7 +629,6 @@ for linking") # define libc_hidden_data_def_alias(name, alias) hidden_data_def_alias (name, alias) # define libc_hidden_tls_def(name) hidden_tls_def (name) # define libc_hidden_data_weak(name) hidden_data_weak (name) -# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libc_hidden_proto(name, attrs...) # define libc_hidden_proto_alias(name, alias, attrs...) @@ -661,228 +640,83 @@ for linking") # define libc_hidden_data_def_alias(name, alias) # define libc_hidden_tls_def(name) # define libc_hidden_data_weak(name) -# define libc_hidden_data_ver(local, name) #endif #if IS_IN (rtld) # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define rtld_hidden_def(name) hidden_def (name) # define rtld_hidden_weak(name) hidden_weak (name) -# define rtld_hidden_ver(local, name) hidden_ver (local, name) # define rtld_hidden_data_def(name) hidden_data_def (name) -# define rtld_hidden_tls_def(name) hidden_tls_def (name) -# define rtld_hidden_data_weak(name) hidden_data_weak (name) -# define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define rtld_hidden_proto(name, attrs...) -# define rtld_hidden_tls_proto(name, attrs...) # define rtld_hidden_def(name) # define rtld_hidden_weak(name) -# define rtld_hidden_ver(local, name) # define rtld_hidden_data_def(name) -# define rtld_hidden_tls_def(name) -# define rtld_hidden_data_weak(name) -# define rtld_hidden_data_ver(local, name) #endif #if IS_IN (libm) # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define libm_hidden_def(name) hidden_def (name) # define libm_hidden_weak(name) hidden_weak (name) # define libm_hidden_ver(local, name) hidden_ver (local, name) -# define libm_hidden_data_def(name) hidden_data_def (name) -# define libm_hidden_tls_def(name) hidden_tls_def (name) -# define libm_hidden_data_weak(name) hidden_data_weak (name) -# define libm_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libm_hidden_proto(name, attrs...) -# define libm_hidden_tls_proto(name, attrs...) # define libm_hidden_def(name) # define libm_hidden_weak(name) # define libm_hidden_ver(local, name) -# define libm_hidden_data_def(name) -# define libm_hidden_tls_def(name) -# define libm_hidden_data_weak(name) -# define libm_hidden_data_ver(local, name) #endif #if IS_IN (libmvec) -# define libmvec_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libmvec_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define libmvec_hidden_def(name) hidden_def (name) -# define libmvec_hidden_weak(name) hidden_weak (name) -# define libmvec_hidden_ver(local, name) hidden_ver (local, name) -# define libmvec_hidden_data_def(name) hidden_data_def (name) -# define libmvec_hidden_tls_def(name) hidden_tls_def (name) -# define libmvec_hidden_data_weak(name) hidden_data_weak (name) -# define libmvec_hidden_data_ver(local, name) hidden_data_ver (local, name) #else -# define libmvec_hidden_proto(name, attrs...) -# define libmvec_hidden_tls_proto(name, attrs...) # define libmvec_hidden_def(name) -# define libmvec_hidden_weak(name) -# define libmvec_hidden_ver(local, name) -# define libmvec_hidden_data_def(name) -# define libmvec_hidden_tls_def(name) -# define libmvec_hidden_data_weak(name) -# define libmvec_hidden_data_ver(local, name) #endif #if IS_IN (libresolv) # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libresolv_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) # define libresolv_hidden_def(name) hidden_def (name) -# define libresolv_hidden_weak(name) hidden_weak (name) -# define libresolv_hidden_ver(local, name) hidden_ver (local, name) # define libresolv_hidden_data_def(name) hidden_data_def (name) -# define libresolv_hidden_tls_def(name) hidden_tls_def (name) -# define libresolv_hidden_data_weak(name) hidden_data_weak (name) -# define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libresolv_hidden_proto(name, attrs...) -# define libresolv_hidden_tls_proto(name, attrs...) # define libresolv_hidden_def(name) -# define libresolv_hidden_weak(name) -# define libresolv_hidden_ver(local, name) # define libresolv_hidden_data_def(name) -# define libresolv_hidden_tls_def(name) -# define libresolv_hidden_data_weak(name) -# define libresolv_hidden_data_ver(local, name) #endif #if IS_IN (libpthread) # define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libpthread_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) # define libpthread_hidden_def(name) hidden_def (name) -# define libpthread_hidden_weak(name) hidden_weak (name) -# define libpthread_hidden_ver(local, name) hidden_ver (local, name) -# define libpthread_hidden_data_def(name) hidden_data_def (name) -# define libpthread_hidden_tls_def(name) hidden_tls_def (name) -# define libpthread_hidden_data_weak(name) hidden_data_weak (name) -# define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libpthread_hidden_proto(name, attrs...) -# define libpthread_hidden_tls_proto(name, attrs...) # define libpthread_hidden_def(name) -# define libpthread_hidden_weak(name) -# define libpthread_hidden_ver(local, name) -# define libpthread_hidden_data_def(name) -# define libpthread_hidden_tls_def(name) -# define libpthread_hidden_data_weak(name) -# define libpthread_hidden_data_ver(local, name) #endif #if IS_IN (librt) # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define librt_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) -# define librt_hidden_def(name) hidden_def (name) -# define librt_hidden_weak(name) hidden_weak (name) # define librt_hidden_ver(local, name) hidden_ver (local, name) -# define librt_hidden_data_def(name) hidden_data_def (name) -# define librt_hidden_tls_def(name) hidden_tls_def (name) -# define librt_hidden_data_weak(name) hidden_data_weak (name) -# define librt_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define librt_hidden_proto(name, attrs...) -# define librt_hidden_tls_proto(name, attrs...) -# define librt_hidden_def(name) -# define librt_hidden_weak(name) # define librt_hidden_ver(local, name) -# define librt_hidden_data_def(name) -# define librt_hidden_tls_def(name) -# define librt_hidden_data_weak(name) -# define librt_hidden_data_ver(local, name) -#endif - -#if IS_IN (libdl) -# define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libdl_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) -# define libdl_hidden_def(name) hidden_def (name) -# define libdl_hidden_weak(name) hidden_weak (name) -# define libdl_hidden_ver(local, name) hidden_ver (local, name) -# define libdl_hidden_data_def(name) hidden_data_def (name) -# define libdl_hidden_tls_def(name) hidden_tls_def (name) -# define libdl_hidden_data_weak(name) hidden_data_weak (name) -# define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name) -#else -# define libdl_hidden_proto(name, attrs...) -# define libdl_hidden_tls_proto(name, attrs...) -# define libdl_hidden_def(name) -# define libdl_hidden_weak(name) -# define libdl_hidden_ver(local, name) -# define libdl_hidden_data_def(name) -# define libdl_hidden_tls_def(name) -# define libdl_hidden_data_weak(name) -# define libdl_hidden_data_ver(local, name) #endif #if IS_IN (libnsl) # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libnsl_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) # define libnsl_hidden_nolink_def(name, version) hidden_nolink (name, libnsl, version) -# define libnsl_hidden_weak(name) hidden_weak (name) -# define libnsl_hidden_ver(local, name) hidden_ver (local, name) -# define libnsl_hidden_data_def(name) hidden_data_def (name) -# define libnsl_hidden_tls_def(name) hidden_tls_def (name) -# define libnsl_hidden_data_weak(name) hidden_data_weak (name) -# define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libnsl_hidden_proto(name, attrs...) -# define libnsl_hidden_tls_proto(name, attrs...) -# define libnsl_hidden_weak(name) -# define libnsl_hidden_ver(local, name) -# define libnsl_hidden_data_def(name) -# define libnsl_hidden_tls_def(name) -# define libnsl_hidden_data_weak(name) -# define libnsl_hidden_data_ver(local, name) #endif #define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs) #define libc_hidden_builtin_def(name) libc_hidden_def (name) -#define libc_hidden_builtin_weak(name) libc_hidden_weak (name) -#define libc_hidden_builtin_ver(local, name) libc_hidden_ver (local, name) #define libc_hidden_ldbl_proto(name, attrs...) libc_hidden_proto (name, ##attrs) #ifdef __ASSEMBLER__ # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name) #endif -#if IS_IN (libutil) -# define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libutil_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) -# define libutil_hidden_def(name) hidden_def (name) -# define libutil_hidden_weak(name) hidden_weak (name) -# define libutil_hidden_ver(local, name) hidden_ver (local, name) -# define libutil_hidden_data_def(name) hidden_data_def (name) -# define libutil_hidden_tls_def(name) hidden_tls_def (name) -# define libutil_hidden_data_weak(name) hidden_data_weak (name) -# define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name) -#else -# define libutil_hidden_proto(name, attrs...) -# define libutil_hidden_tls_proto(name, attrs...) -# define libutil_hidden_def(name) -# define libutil_hidden_weak(name) -# define libutil_hidden_ver(local, name) -# define libutil_hidden_data_def(name) -# define libutil_hidden_tls_def(name) -# define libutil_hidden_data_weak(name) -# define libutil_hidden_data_ver(local, name) -#endif - #if IS_IN (libanl) # define libanl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libanl_hidden_def(name) hidden_def (name) #else # define libanl_hidden_proto(name, attrs...) -# define libanl_hidden_def(name) #endif /* Get some dirty hacks. */ @@ -893,11 +727,8 @@ for linking") #ifndef __ASSEMBLER__ # define attribute_compat_text_section \ __attribute__ ((section (".text.compat"))) -# define attribute_compat_data_section \ - __attribute__ ((section (".data.compat"))) #else # define compat_text_section .section ".text.compat", "ax"; -# define compat_data_section .section ".data.compat", "aw"; #endif /* Helper / base macros for indirect function symbols. */
reply other threads:[~2022-07-05 4:15 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220705041552.AEBE6385828E@sourceware.org \ --to=maskray@sourceware.org \ --cc=glibc-cvs@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: linkBe 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).