From patchwork Fri May 24 15:39:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 32851 Received: (qmail 91363 invoked by alias); 24 May 2019 15:39:46 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 91308 invoked by uid 89); 24 May 2019 15:39:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: sym2.noone.org From: Tobias Klauser To: libc-alpha@sourceware.org Cc: Adhemerval Zanella Subject: [PATCH] Replace PREPARE_VERSION macro with inline function Date: Fri, 24 May 2019 17:39:41 +0200 Message-Id: <20190524153941.10128-1-tklauser@distanz.ch> Suggested by Adhemerval Zanella 2019-05-24 Tobias Klauser * sysdeps/unix/sysv/linux/dl-vdso.h (PREPARE_VERSION): Remove macro. (prepare_version_base): New helper inline function. (prepare_version): New macro replacing PREPARE_VERSION. (PREPARE_VERSION_KNOWN): Use prepare_version instead of PREPARE_VERSION. --- sysdeps/unix/sysv/linux/dl-vdso.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sysdeps/unix/sysv/linux/dl-vdso.h b/sysdeps/unix/sysv/linux/dl-vdso.h index 9e61ca742363..c418c697a3a4 100644 --- a/sysdeps/unix/sysv/linux/dl-vdso.h +++ b/sysdeps/unix/sysv/linux/dl-vdso.h @@ -24,19 +24,19 @@ #include /* Create version number record for lookup. */ -#define PREPARE_VERSION(var, vname, vhash) \ - struct r_found_version var; \ - var.name = vname; \ - var.hidden = 1; \ - var.hash = vhash; \ - assert (var.hash == _dl_elf_hash (var.name)); \ - /* We don't have a specific file where the symbol can be found. */ \ - var.filename = NULL +static inline struct r_found_version +prepare_version_base (const char *name, ElfW(Word) hash) +{ + assert (hash == _dl_elf_hash (name)); + return (struct r_found_version) { name, hash, 1, NULL }; +} +#define prepare_version(vname) \ + prepare_version_base (VDSO_NAME_##vname, VDSO_HASH_##vname) /* Use this for the known version sets defined below, where we record their precomputed hash values only once, in this file. */ #define PREPARE_VERSION_KNOWN(var, vname) \ - PREPARE_VERSION (var, VDSO_NAME_##vname, VDSO_HASH_##vname) + struct r_found_version var = prepare_version (vname); #define VDSO_NAME_LINUX_2_6 "LINUX_2.6" #define VDSO_HASH_LINUX_2_6 61765110