From patchwork Tue Mar 2 19:30:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 42203 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC4BE3850418; Tue, 2 Mar 2021 19:30:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC4BE3850418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614713445; bh=wlo/OuilrTAHoyxybCCzZxcjTrB3bmOeRzdPtWlCnBs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=l2Ep6Ia0cVWJnZ6XYrBNQ6AUHmlpwpU+Unzfv7XoEzSitVeETiMuSB5JGeQKXmxdK DwLWCtjoG1A2uVu6CUMUeX101sBNe9ucuPZIWZKpi3ot2Au5T5Kn9p/Xv4iBfgc46U W5yvVwmj0Z66mjyUAE1z/77bJZ/9uy1YfFjM5sPs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 0B6CF3851C2A for ; Tue, 2 Mar 2021 19:30:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0B6CF3851C2A Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-266-jBxMNq8pMUGIFxjCuxUVvQ-1; Tue, 02 Mar 2021 14:30:40 -0500 X-MC-Unique: jBxMNq8pMUGIFxjCuxUVvQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 404C918B6144 for ; Tue, 2 Mar 2021 19:30:39 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9883860BFA for ; Tue, 2 Mar 2021 19:30:38 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH v2] : Support compat_symbol_reference for _ISOMAC Date: Tue, 02 Mar 2021 20:30:42 +0100 Message-ID: <87y2f5wdy5.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "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) \