From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 41E693857C60 for ; Fri, 19 Mar 2021 20:07:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 41E693857C60 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-422-ACEDPxC0PYexiLZ-eTgSvQ-1; Fri, 19 Mar 2021 16:07:38 -0400 X-MC-Unique: ACEDPxC0PYexiLZ-eTgSvQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 649489CC03 for ; Fri, 19 Mar 2021 20:07:37 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-80.ams2.redhat.com [10.36.112.80]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC4981C95E for ; Fri, 19 Mar 2021 20:07:36 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v2 2/3] locale: Use compat_symbol_reference in _nl_postload_ctype In-Reply-To: References: Message-Id: Date: Fri, 19 Mar 2021 21:07:47 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.8 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, URIBL_BLACK 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 20:07:42 -0000 These symbol usages are not definitions, so compat_symbol_reference is more appropriate than compat_symbol. compat_symbol_reference is also safe to emit multiple times (in case the inline assembly is duplicated; this is possible because it is nested in a function). compat_symbol does not necessarily have this property because it is intended to provide a symbol definition. --- locale/lc-ctype.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/locale/lc-ctype.c b/locale/lc-ctype.c index 1db0605c82..7c97480cbd 100644 --- a/locale/lc-ctype.c +++ b/locale/lc-ctype.c @@ -93,12 +93,14 @@ _nl_postload_ctype (void) We need those relocations so that a versioned definition with a COPY reloc in an executable will override the libc.so definition. */ -compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0); -compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0); -compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0); -compat_symbol (libc, __ctype32_b, __ctype32_b, GLIBC_2_0); -compat_symbol (libc, __ctype32_tolower, __ctype32_tolower, GLIBC_2_2); -compat_symbol (libc, __ctype32_toupper, __ctype32_toupper, GLIBC_2_2); +compat_symbol_reference (libc, __ctype_b, __ctype_b, GLIBC_2_0); +compat_symbol_reference (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0); +compat_symbol_reference (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0); +compat_symbol_reference (libc, __ctype32_b, __ctype32_b, GLIBC_2_0); +compat_symbol_reference (libc, __ctype32_tolower, __ctype32_tolower, + GLIBC_2_2); +compat_symbol_reference (libc, __ctype32_toupper, __ctype32_toupper, + GLIBC_2_2); __ctype_b = current (uint16_t, CLASS, 128); __ctype_toupper = current (int32_t, TOUPPER, 128); -- 2.30.2