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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 3B5DE385F015 for ; Thu, 25 Aug 2022 18:58:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B5DE385F015 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661453922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VQOFh03qMT0GBqA3F9+lziinm9my73o8FiFBFTv3Dyw=; b=FSceYBy3q4uOwO6jfEYF9fnKTZtT6tVH8RHlBplbb3Lt4UlAMFZ4AhOZjG/4IKtlMWi8Sk ROZ+MaT/0/V5iubfVF122fljl3jVnhUb7/yKOZeA8PtGP8TeMaMrHJgx6fdKHS8UZP17HQ joFcZXf77MLS8I7MUYQfxcjSljldX7k= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-552-YwjHYlC5NpKU4XrlttuyiA-1; Thu, 25 Aug 2022 14:58:41 -0400 X-MC-Unique: YwjHYlC5NpKU4XrlttuyiA-1 Received: by mail-qk1-f197.google.com with SMTP id v13-20020a05620a0f0d00b006b5f0ec742eso17840044qkl.2 for ; Thu, 25 Aug 2022 11:58:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc; bh=VQOFh03qMT0GBqA3F9+lziinm9my73o8FiFBFTv3Dyw=; b=382aJtSKv7VscUTksYlvgFpGtKKIVlMAHCgoU3JMkWplbcSRs7h0oLmsMNsQ764C1v Z9BiePlS8n0dyo5A+GuI6JjE7NwfsqVBjJAk9A9Iyeolu586RE7IKrmpbYY3WL9WEVkO OX1E4wWic5Xmw5WpmcL70IF+DhfAX9bpm0Kuomb9JD7NaRZw5Cs/iEUAPiiuxHFJ7meB DHEO6MqqgZ3geLyXK8wcjUBxLKJtCy1HkThwkU6Q3FBhHAsYMvSiaE6t+kvqcPPFCYo/ vvhoBS+52Uy6727IS9IUwDW4QiaD3Re5bHNeWMfvqVx9uMPfoudrlMpTfU7Pi7Dn5roM vQqw== X-Gm-Message-State: ACgBeo0TMPNTlonbgVXQm+HkY/DchTediXdDwH9L+oONKfT6TwooLBaf gWEX2i/9BtqskibQ/YMp3RVGV0buGveK+46aW87qkNIEwGQaOYMATDzGZwI/te2PT+FHPMKOa49 dZT70zBhJDObWYPrxrrpn X-Received: by 2002:ad4:5764:0:b0:496:9c18:e929 with SMTP id r4-20020ad45764000000b004969c18e929mr4914940qvx.61.1661453920989; Thu, 25 Aug 2022 11:58:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR51ETbqYiW42Ox1M+teypc7A5XLmERJx/BTXG2P8VAeZ5zto0TZmrb4hiEkSYOubQQV+jUbSA== X-Received: by 2002:ad4:5764:0:b0:496:9c18:e929 with SMTP id r4-20020ad45764000000b004969c18e929mr4914925qvx.61.1661453920715; Thu, 25 Aug 2022 11:58:40 -0700 (PDT) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id v2-20020a05620a440200b006bad7a2964fsm153396qkp.78.2022.08.25.11.58.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Aug 2022 11:58:40 -0700 (PDT) Message-ID: Date: Thu, 25 Aug 2022 14:58:39 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] s390: Move hwcaps/platform names out of _rtld_global_ro To: Florian Weimer , libc-alpha@sourceware.org Cc: Stefan Liebler References: <87pmgo9w86.fsf@oldenburg.str.redhat.com> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <87pmgo9w86.fsf@oldenburg.str.redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,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_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 8/25/22 11:30, Florian Weimer wrote: > Changes to these arrays are often backported to stable releases, > but additions to these arrays shift the offsets of the following > _rltd_global_ro members, thus breaking the GLIBC_PRIVATE ABI. > > Obviously, this change is itself an internal ABI break, but at least > it will avoid further ABI breaks going forward. > > Tested on s390x-linux-gnu. LD_SHOW_AUXV output on a z15 still looks > okay. Looking forward to a v2. > --- > sysdeps/s390/Makefile | 2 + > sysdeps/s390/dl-procinfo-s390.c | 32 +++++++++++++++ > sysdeps/s390/dl-procinfo.c | 62 +----------------------------- > sysdeps/s390/dl-procinfo.h | 8 ++-- > sysdeps/unix/sysv/linux/s390/dl-procinfo.h | 2 +- > 5 files changed, 42 insertions(+), 64 deletions(-) > > diff --git a/sysdeps/s390/Makefile b/sysdeps/s390/Makefile > index 5b6a96579c..1d687a2184 100644 > --- a/sysdeps/s390/Makefile > +++ b/sysdeps/s390/Makefile > @@ -43,6 +43,8 @@ $(modpfx)gconv-modules-s390.conf: ../sysdeps/s390/gconv-modules-s390.conf \ > endif > > ifeq ($(subdir),elf) > +sysdep-dl-routines += dl-procinfo-s390 > + OK. > ifeq ($(build-shared),yes) > tests += tst-dl-runtime-resolve-noaudit tst-dl-runtime-resolve-audit \ > tst-dl-runtime-profile-noaudit > diff --git a/sysdeps/s390/dl-procinfo-s390.c b/sysdeps/s390/dl-procinfo-s390.c > new file mode 100644 > index 0000000000..f3587f0354 > --- /dev/null > +++ b/sysdeps/s390/dl-procinfo-s390.c > @@ -0,0 +1,32 @@ > +/* Data for s390 version of processor capability information. > + Copyright (C) 2006-2022 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 > + . */ > + > +#include OK. You have access to the count macros. > + > +const char _dl_s390_cap_flags[_DL_HWCAP_COUNT][9] = > + { > + "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", "edat", "etf3eh", > + "highgprs", "te", "vx", "vxd", "vxe", "gs", "vxe2", "vxp", "sort", "dflt", > + "vxp2", "nnpa", "pcimio", "sie" > + }; > + > +const char _dl_s390_platforms[11][7] = s/11/_DL_PLATFORMS_COUNT/g ? > + { > + "g5", "z900", "z990", "z9-109", "z10", "z196", "zEC12", "z13", "z14", "z15", > + "z16" > + }; OK. > diff --git a/sysdeps/s390/dl-procinfo.c b/sysdeps/s390/dl-procinfo.c > index f142221a17..5896e5a875 100644 > --- a/sysdeps/s390/dl-procinfo.c > +++ b/sysdeps/s390/dl-procinfo.c > @@ -16,66 +16,8 @@ > License along with the GNU C Library; if not, see > . */ > > -/* This information must be kept in sync with the _DL_HWCAP_COUNT and > - _DL_PLATFORM_COUNT definitions in procinfo.h. > - > - If anything should be added here check whether the size of each string > - is still ok with the given array size. > - > - All the #ifdefs in the definitions are quite irritating but > - necessary if we want to avoid duplicating the information. There > - are three different modes: > - > - - PROCINFO_DECL is defined. This means we are only interested in > - declarations. > - > - - PROCINFO_DECL is not defined: > - > - + if SHARED is defined the file is included in an array > - initializer. The .element = { ... } syntax is needed. > - > - + if SHARED is not defined a normal array initialization is > - needed. > - */ > - > -#ifndef PROCINFO_CLASS > -# define PROCINFO_CLASS > -#endif > - > -#if !defined PROCINFO_DECL && defined SHARED > - ._dl_s390_cap_flags > -#else > -PROCINFO_CLASS const char _dl_s390_cap_flags[23][9] > -#endif > -#ifndef PROCINFO_DECL > -= { > - "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", "edat", "etf3eh", > - "highgprs", "te", "vx", "vxd", "vxe", "gs", "vxe2", "vxp", "sort", "dflt", > - "vxp2", "nnpa", "pcimio", "sie" > - } > -#endif > -#if !defined SHARED || defined PROCINFO_DECL > -; > -#else > -, > -#endif > - > -#if !defined PROCINFO_DECL && defined SHARED > - ._dl_s390_platforms > -#else > -PROCINFO_CLASS const char _dl_s390_platforms[11][7] > -#endif > -#ifndef PROCINFO_DECL > -= { > - "g5", "z900", "z990", "z9-109", "z10", "z196", "zEC12", "z13", "z14", "z15", > - "z16" > - } > -#endif > -#if !defined SHARED || defined PROCINFO_DECL > -; > -#else > -, > -#endif > +/* The data is now in sysdeps/s390/dl-procinfo-s390.c. */ s/The data/The procinfo and platform data/g > > +/* Needed by the sysdeps/unix/sysv/linux/dl-vdso-setup.c glic. */ > #undef PROCINFO_DECL > #undef PROCINFO_CLASS > diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h > index 1f4e3875ba..df6bace901 100644 > --- a/sysdeps/s390/dl-procinfo.h > +++ b/sysdeps/s390/dl-procinfo.h > @@ -21,8 +21,10 @@ > #include > > #define _DL_HWCAP_COUNT 23 > +extern const char _dl_s390_cap_flags[_DL_HWCAP_COUNT][9] attribute_hidden; > > #define _DL_PLATFORMS_COUNT 11 > +extern const char _dl_s390_platforms[11][7] attribute_hidden; s/11/_DL_PLATFORMS_COUNT/g ? > > /* The kernel provides up to 32 capability bits with elf_hwcap. */ > #define _DL_FIRST_PLATFORM 32 > @@ -78,7 +80,7 @@ static inline const char * > __attribute__ ((unused)) > _dl_hwcap_string (int idx) > { > - return GLRO(dl_s390_cap_flags)[idx]; > + return _dl_s390_cap_flags[idx]; > }; > > static inline int > @@ -89,7 +91,7 @@ _dl_string_hwcap (const char *str) > > for (i = 0; i < _DL_HWCAP_COUNT; i++) > { > - if (strcmp (str, GLRO(dl_s390_cap_flags)[i]) == 0) > + if (strcmp (str, _dl_s390_cap_flags[i]) == 0) > return i; > } > return -1; > @@ -104,7 +106,7 @@ _dl_string_platform (const char *str) > if (str != NULL) > for (i = 0; i < _DL_PLATFORMS_COUNT; ++i) > { > - if (strcmp (str, GLRO(dl_s390_platforms)[i]) == 0) > + if (strcmp (str, _dl_s390_platforms[i]) == 0) > return _DL_FIRST_PLATFORM + i; > } OK. And this works for ldconfig.c also, which is good. > return -1; > diff --git a/sysdeps/unix/sysv/linux/s390/dl-procinfo.h b/sysdeps/unix/sysv/linux/s390/dl-procinfo.h > index 46790c2103..a8e27149fd 100644 > --- a/sysdeps/unix/sysv/linux/s390/dl-procinfo.h > +++ b/sysdeps/unix/sysv/linux/s390/dl-procinfo.h > @@ -39,7 +39,7 @@ _dl_procinfo (unsigned int type, unsigned long int word) > > for (i = 0; i < _DL_HWCAP_COUNT; ++i) > if (word & (1UL << i)) > - _dl_printf (" %s", GLRO(dl_s390_cap_flags)[i]); > + _dl_printf (" %s", _dl_s390_cap_flags[i]); OK. > > _dl_printf ("\n"); > > > base-commit: 025a8cce63a1d9b3ea9e84d0e844f14ec872e184 > -- Cheers, Carlos.