From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by sourceware.org (Postfix) with ESMTPS id C881C3857C7F for ; Fri, 19 Mar 2021 18:47:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C881C3857C7F Received: by mail-qk1-x72e.google.com with SMTP id g15so4000677qkl.4 for ; Fri, 19 Mar 2021 11:47:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hNfKDtukNkD8sxGoaygttPGZSZK7LMhi+oBDOGSJnWI=; b=HWXN1jw/V+X3lsE3CitOQjglyiiffJ5LWn530kv3v8RcQbbXSpnx5upgcgJxdqjcLB 8cAUQFjHVM0KZ4lB42y+f0B8NJTxfl3/KjNynsMnJAxkZtV9+VdMfNJ9F9yRIj2W0Vwo 4+7m31X7v+BFYzx2J2/FWLLgiHlHGtMBUVpMm/q9OMT8dAXTbe8gBKOrMST9ZAe44EsY qzpa1bsup/kG0wgSaq0op2RjACJSiSI2ypo2ULPMOBRW5L+KQ7+Nx1FQHjkDfxqoo8np C0loWoRTbI2XTFWM17K+nm9lZFahCugYvmoSNET6Ea90awevt5x85jkW6p3cwvpwrTKm TL4w== X-Gm-Message-State: AOAM530nymBdTsstEiSDjyBK3utyEu9FuZK4aEfRzGbUP7eNetAnhBL2 NhgXqfK5WZ2IUFOZw01MDZ8guIplz+4EscLV X-Google-Smtp-Source: ABdhPJxBCbFFjNDrkgnpeobbqSjnPFkGSa5mNMDHhe7+Z5KP8gLNkbuPg8X130u4vdr4twlPLqtkkw== X-Received: by 2002:a37:755:: with SMTP id 82mr38253qkh.52.1616179645225; Fri, 19 Mar 2021 11:47:25 -0700 (PDT) Received: from [192.168.1.4] ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id k126sm5262782qkb.4.2021.03.19.11.47.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Mar 2021 11:47:24 -0700 (PDT) Subject: Re: [RFC 1/2] Change how the symbol_version_reference macro is defined To: libc-alpha@sourceware.org References: <0f5cee98e3474cbcf1d699334b2d9e993f1c3776.1616095061.git.fweimer@redhat.com> From: Adhemerval Zanella Message-ID: <564b88b3-7010-69ea-f02f-668d982642fb@linaro.org> Date: Fri, 19 Mar 2021 15:47:22 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <0f5cee98e3474cbcf1d699334b2d9e993f1c3776.1616095061.git.fweimer@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2021 18:47:28 -0000 On 18/03/2021 17:07, Florian Weimer via Libc-alpha wrote: > A subsequent change will require including for defining > symbol_version_reference. should not include > for _ISOMAC, so it cannot define symbol_version_reference > anymore, but symbol_version_reference is needed even > for _ISOMAC. Moving the definition of symbol_version_reference to a > separate file makes it possible to use a single > definition for both cases. LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > include/libc-symbols.h | 16 +++------------- > include/libc-symver.h | 38 ++++++++++++++++++++++++++++++++++++++ > include/shlib-compat.h | 3 +++ > 3 files changed, 44 insertions(+), 13 deletions(-) > create mode 100644 include/libc-symver.h > > diff --git a/include/libc-symbols.h b/include/libc-symbols.h > index c83e550b03..ce5f75a1a2 100644 > --- a/include/libc-symbols.h > +++ b/include/libc-symbols.h > @@ -59,19 +59,6 @@ > # 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 Ok. > @@ -97,6 +84,9 @@ > > #include > > +/* Obtain the definition of symbol_version_reference. */ > +#include > + > /* When PIC is defined and SHARED isn't defined, we are building PIE > by default. */ > #if defined PIC && !defined SHARED Ok. > diff --git a/include/libc-symver.h b/include/libc-symver.h > new file mode 100644 > index 0000000000..11c77ae1cd > --- /dev/null > +++ b/include/libc-symver.h > @@ -0,0 +1,38 @@ > +/* Symbol version management. > + Copyright (C) 1995-2021 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +/* This file is included from for !_ISOMAC, and > + unconditionally from . */ > + > +#ifndef _LIBC_SYMVER_H > +#define _LIBC_SYMVER_H 1 > + > +/* 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 > + > +#endif /* _LIBC_SYMVER_H */ Ok. > diff --git a/include/shlib-compat.h b/include/shlib-compat.h > index 28baef1ea4..b874e2588f 100644 > --- a/include/shlib-compat.h > +++ b/include/shlib-compat.h > @@ -21,6 +21,9 @@ > > # include > > +/* Obtain the definition of symbol_version_reference. */ > +#include > + > /* The file abi-versions.h (generated by scripts/abi-versions.awk) defines > symbols like `ABI_libm_GLIBC_2_0' for each version set in the source > code for each library. For a version set that is subsumed by a later > Ok.