From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id AF58A3858D28 for ; Tue, 2 May 2023 03:53:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF58A3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1a7ff4a454eso20095ad.0 for ; Mon, 01 May 2023 20:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682999590; x=1685591590; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zCKKim66Hkz1gkGAacOjOCJX3c61M+p2YFIcw14LHck=; b=jG6UhM9wzsKc10qy3WLojZAHZ6Nca8GoNIJc5cez7p0Bz5tk5CUWDL8E5KSN0vDKtM GM+JIx+P59sMOvwiYDkrdNlr8enMiMeJKlABTp9oi9THX54/MmCVmTtvaFESrojol9vY g61jeKPYDFw7+mttoiPkt2AInmpOz5Bb8ngzdZXeQ2EI76pOf7ZmyFO47PatfZKinVCk vjOHTVDg709dH9lFkXeajoHEW2bfL4K8FB3TzNjMTxoKPBR+Pyx1KMIvxhJOWvQE57GL PhWRZWzmoByMrJKl6aFVR9iocB93O575+Kr51zAc2LVeKZ9wDPWt4xILf+BV9EK6RWL2 QJ4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682999590; x=1685591590; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zCKKim66Hkz1gkGAacOjOCJX3c61M+p2YFIcw14LHck=; b=ObXXdjCz6y1gqkSJ1sQduU5XQzppDozAhdqWc8W2y1jPsO0fyHIYTe9iwDA1c0IYJa JI7mLEVgN0kXyaz3JAA3zkmx95XXuUNi0IE4W3YeLGGncEPfWK82eua6qzJY9mHen2ka RFk8zODHb3daJTkVH2uJNI2QeOPHUnaarbY4zy3ecw3H6hgYYcWMOGknHUGACOPKET3Z av6uUMoOHDEWHtmGKdBS7T5Z5pLSjt6diZoYeeejMLMyaAoSzGLcJ8GGpuR02SdpryNn TFQj6xlEFTGdLPnaKlFGHJvBOX9mwwUYcyF4paKfmZ5xxSzzBifohYwItGO96DghzSpP F9Sg== X-Gm-Message-State: AC+VfDyQUcyJawl3G/WgbPooWMUEI0HXiw8sKuM3wV2+p1/3JVFC6nZA +z2pcvXuWhg5jTgtA/URPTLD47hy8yfBbaefzMS4aZIPtQHJK/Z3okDBFg== X-Google-Smtp-Source: ACHHUZ4bncLJ4CXe0dv9SmB/EryZILs6x6wl16gVvJQLmr83EI2Ix280TgdD7ZKzmrq/gBmdeKBgweyaCi0hp/UG7OQ= X-Received: by 2002:a17:902:e74a:b0:1a1:c3bf:810b with SMTP id p10-20020a170902e74a00b001a1c3bf810bmr157626plf.6.1682999589550; Mon, 01 May 2023 20:53:09 -0700 (PDT) MIME-Version: 1.0 References: <20230428175458.4768-1-palmer@rivosinc.com> In-Reply-To: <20230428175458.4768-1-palmer@rivosinc.com> From: Fangrui Song Date: Mon, 1 May 2023 20:52:58 -0700 Message-ID: Subject: Re: [PATCH] Revert "riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC." To: Palmer Dabbelt Cc: joseph@codesourcery.com, libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-23.5 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Fri, Apr 28, 2023 at 10:55=E2=80=AFAM Palmer Dabbelt wrote: > > This one breaks the build, I had it sitting on a branch and must have > forgotten to test it. > > This reverts commit 117e8b341c5c0ace8d65feeef136fececb3fdc9c. > > Link:https://inbox.sourceware.org/libc-alpha/mhng-0d9fb5a0-63fa-4b02-8029= -7c20232f39ee@palmer-ri-x1c9/T/#t > Signed-off-by: Palmer Dabbelt > --- > I'm ging to put together a build-many-glibcs setup, but that almost > always ends up taking a bit for me. Happy to just revert this until I > can get one that works, sorry for the headaches. I think reverting this will be a cleaner solution! Reviewed-by: Fangrui Song > --- > elf/elf.h | 7 ------- > manual/platform.texi | 6 ------ > sysdeps/riscv/dl-dtprocnum.h | 21 --------------------- > sysdeps/riscv/dl-machine.h | 26 -------------------------- > 4 files changed, 60 deletions(-) > delete mode 100644 sysdeps/riscv/dl-dtprocnum.h > > diff --git a/elf/elf.h b/elf/elf.h > index 4f65b5a32d..94ca23c1bb 100644 > --- a/elf/elf.h > +++ b/elf/elf.h > @@ -3933,13 +3933,6 @@ enum > > #define R_TILEGX_NUM 130 > > -/* RISC-V specific values for the Dyn d_tag field. */ > -#define DT_RISCV_VARIANT_CC (DT_LOPROC + 1) > -#define DT_RISCV_NUM 2 > - > -/* RISC-V specific values for the st_other field. */ > -#define STO_RISCV_VARIANT_CC 0x80 > - > /* RISC-V ELF Flags */ > #define EF_RISCV_RVC 0x0001 > #define EF_RISCV_FLOAT_ABI 0x0006 > diff --git a/manual/platform.texi b/manual/platform.texi > index 714c07813f..c6ed73cb97 100644 > --- a/manual/platform.texi > +++ b/manual/platform.texi > @@ -121,12 +121,6 @@ when it is not allowed, the priority is set to mediu= m. > @node RISC-V > @appendixsec RISC-V-specific Facilities > > -Functions that are lazily bound must be compatible with the standard cal= ling > -convention. When a function is annotated with STO_RISCV_VARIANT_CC, it m= eans > -this function is not compatible with the standard calling convention. Th= e > -dynamic linker will directly resolve it instead of using the lazy bindin= g > -mechanism. > - > Cache management facilities specific to RISC-V systems that implement th= e Linux > ABI are declared in @file{sys/cachectl.h}. > > diff --git a/sysdeps/riscv/dl-dtprocnum.h b/sysdeps/riscv/dl-dtprocnum.h > deleted file mode 100644 > index 281c5aadeb..0000000000 > --- a/sysdeps/riscv/dl-dtprocnum.h > +++ /dev/null > @@ -1,21 +0,0 @@ > -/* Configuration of lookup functions. RISC-V version. > - Copyright (C) 2023 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 > - . */ > - > -/* Number of extra dynamic section entries for this architecture. By > - default there are none. */ > -#define DT_THISPROCNUM DT_RISCV_NUM > diff --git a/sysdeps/riscv/dl-machine.h b/sysdeps/riscv/dl-machine.h > index 0e6c0bb155..c0c9bd93ad 100644 > --- a/sysdeps/riscv/dl-machine.h > +++ b/sysdeps/riscv/dl-machine.h > @@ -53,9 +53,6 @@ > || (__WORDSIZE =3D=3D 64 && (type) =3D=3D R_RISCV_TLS_TPREL64))) \ > | (ELF_RTYPE_CLASS_COPY * ((type) =3D=3D R_RISCV_COPY))) > > -//* Translate a processor specific dynamic tag to the index in l_info ar= ray. */ > -#define DT_RISCV(x) (DT_RISCV_##x - DT_LOPROC + DT_NUM) > - > /* Return nonzero iff ELF header is compatible with the running host. *= / > static inline int __attribute_used__ > elf_machine_matches_host (const ElfW(Ehdr) *ehdr) > @@ -284,29 +281,6 @@ elf_machine_lazy_rel (struct link_map *map, struct r= _scope_elem *scope[], > /* Check for unexpected PLT reloc type. */ > if (__glibc_likely (r_type =3D=3D R_RISCV_JUMP_SLOT)) > { > - if (__glibc_unlikely (map->l_info[DT_RISCV (VARIANT_CC)] !=3D NULL= )) > - { > - /* Check the symbol table for variant CC symbols. */ > - const Elf_Symndx symndx =3D ELFW(R_SYM) (reloc->r_info); > - const ElfW(Sym) *symtab =3D > - (const void *)D_PTR (map, l_info[DT_SYMTAB]); > - const ElfW(Sym) *sym =3D &symtab[symndx]; > - if (__glibc_unlikely (sym->st_other & STO_RISCV_VARIANT_CC)) > - { > - /* Avoid lazy resolution of variant CC symbols. */ > - const struct r_found_version *version =3D NULL; > - if (map->l_info[VERSYMIDX (DT_VERSYM)] !=3D NULL) > - { > - const ElfW(Half) *vernum =3D > - (const void *)D_PTR (map, l_info[VERSYMIDX (DT_VERSY= M)]); > - version =3D &map->l_versions[vernum[symndx] & 0x7fff]; > - } > - elf_machine_rela (map, scope, reloc, sym, version, reloc_a= ddr, > - skip_ifunc); > - return; > - } > - } > - > if (__glibc_unlikely (map->l_mach.plt =3D=3D 0)) > { > if (l_addr) > -- > 2.40.0 > --=20 =E5=AE=8B=E6=96=B9=E7=9D=BF