public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver Date: Fri, 28 Oct 2022 17:39:23 +0000 (GMT) [thread overview] Message-ID: <20221028173923.356C73857010@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=24f34ab598e2ae3aeeaceb8466faa0a4f45b993b commit 24f34ab598e2ae3aeeaceb8466faa0a4f45b993b Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Thu Aug 4 09:43:18 2022 -0300 elf: Suppress unused function clang for __ifunc_resolver Diff: --- elf/ifuncmain9.c | 4 ++++ elf/tst-ifunc-fault-lazy.c | 4 ++++ include/libc-symbols.h | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c index d59778d6fe..579c4baed8 100644 --- a/elf/ifuncmain9.c +++ b/elf/ifuncmain9.c @@ -22,6 +22,7 @@ # include <stdbool.h> # include <stdio.h> +# include <libc-diag.h> /* Do not use the test framework, so that the process setup is not disturbed. */ @@ -40,6 +41,8 @@ implementation (void) return random_constant; } +DIAG_PUSH_NEEDS_COMMENT_CLANG; +DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function"); static __typeof__ (implementation) * inhibit_stack_protector resolver (void) @@ -47,6 +50,7 @@ resolver (void) ++resolver_called; return implementation; } +DIAG_POP_NEEDS_COMMENT_CLANG; static int magic (void) __attribute__ ((ifunc ("resolver"))); diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c index 2d72c54081..da73a54850 100644 --- a/elf/tst-ifunc-fault-lazy.c +++ b/elf/tst-ifunc-fault-lazy.c @@ -21,6 +21,7 @@ relocations. */ #include <config.h> +#include <libc-diag.h> #ifdef HAVE_GCC_IFUNC @@ -34,6 +35,8 @@ implementation (void) *p = 0; } +DIAG_PUSH_NEEDS_COMMENT_CLANG; +DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function"); static __typeof__ (implementation) * resolver (void) { @@ -42,6 +45,7 @@ resolver (void) *p = 0; return implementation; } +DIAG_POP_NEEDS_COMMENT_CLANG; static void magic (void) __attribute__ ((ifunc ("resolver"))); diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 140ee0ff6d..579eca0405 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -86,6 +86,7 @@ /* Obtain the definition of symbol_version_reference. */ #include <libc-symver.h> +#include <libc-diag.h> /* When PIC is defined and SHARED isn't defined, we are building PIE by default. */ @@ -750,7 +751,10 @@ for linking") # define __ifunc(type_name, name, expr, arg, init) \ extern __typeof (type_name) name __attribute__ \ ((ifunc (#name "_ifunc"))); \ - __ifunc_resolver (type_name, name, expr, arg, init, static) + DIAG_PUSH_NEEDS_COMMENT_CLANG; \ + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function"); \ + __ifunc_resolver (type_name, name, expr, arg, init, static); \ + DIAG_POP_NEEDS_COMMENT_CLANG; # define __ifunc_hidden(type_name, name, expr, arg, init) \ __ifunc (type_name, name, expr, arg, init)
next reply other threads:[~2022-10-28 17:39 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-28 17:39 Adhemerval Zanella [this message] -- strict thread matches above, loose matches on Subject: below -- 2024-04-17 20:05 Adhemerval Zanella 2024-04-02 15:51 Adhemerval Zanella 2024-02-09 17:29 Adhemerval Zanella 2024-02-07 14:04 Adhemerval Zanella 2024-01-29 17:54 Adhemerval Zanella 2023-12-21 18:51 Adhemerval Zanella 2023-09-28 17:49 Adhemerval Zanella 2023-08-30 12:34 Adhemerval Zanella 2023-02-09 19:46 Adhemerval Zanella 2022-10-04 12:57 Adhemerval Zanella
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=20221028173923.356C73857010@sourceware.org \ --to=azanella@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).