From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id C35193858D37 for ; Fri, 28 Apr 2023 17:55:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C35193858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1a66888cb89so1983955ad.3 for ; Fri, 28 Apr 2023 10:55:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1682704537; x=1685296537; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:from:to:cc:subject:date:message-id:reply-to; bh=B1dn2fuIkgCG24ayNIUcZWUPdP82Xp1Bf/09Boamxx4=; b=ZLwBkcZcz+hGDQOMuXo9lQepsfF3k9uAUYtwX1/hDQYJcHzGQYZnke1w3JmtTbzQbY HiK9V4dkoU1Ewniuou2W7zEcdU2Y47rrpSuhzC4WYq0gkQP5GF/V+vKoytBfytZ3u61+ Oja/FU1x9rAdLBL3zU4na3e+UCTEFENu7lny1uEwcozcVQBlOiC9fIS8XqTU+uavuqTf BLiJCZEibFCkzwL7Q4x+73YNTQn6jxQ5PiGEBmhHgfpV5sVZHTf1vA+wfpr37H2cQ38j eCn5z2bhJXhX7YEtStdFECdpda0d0J5MQxlFvwISk/MZcISKUr3RzOFva888njrJrVyB gyNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682704537; x=1685296537; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=B1dn2fuIkgCG24ayNIUcZWUPdP82Xp1Bf/09Boamxx4=; b=DdIVCONjEe8LWmT3GK3geqDKsEv/1s5WQnSTngH33Hv9blAii7k9JzWP0AU/AjBSJ9 HLX1nm9Wf10o3/c55c5Ney/NYGlb9ZlAesK1lnnQLq+prqCyO3sJXdQQEbeAWIcBXIyo +geP1J4sZRNbBAv6IKM/Iq3t+j9DiEKscirNPojQlesrL2pdJZv6Psy2aZBYsugoQ3hq RhsLxycFZfFwIzfH9aRuR+hGgMnUi5F7ctUneylBFNaSMza/UK10pUrH5eljvaWCHqzI IaptbPzT/5vbpGvEb9loq+Q9Cn8OBfTg9yfmRjJ5p3VtEo7rpPl+C/u7RpDqCuR61HIp OdiQ== X-Gm-Message-State: AC+VfDxqs7pYWWD7NiZzKESjMAJ0THgTLnL39trsEHBvegGrlbpGl9AB 1g9RaGWRZvwFLuhwU2nsOELQUPwKsWiOA5EZiGw= X-Google-Smtp-Source: ACHHUZ6VsSwWzO7r9T4rSLAbnUYKBgFfCxcoCDIcZPiHYK2DftarsNfBq8UudBZGDxpxDH+ZLh9YIQ== X-Received: by 2002:a17:903:245:b0:1a6:37a6:f41a with SMTP id j5-20020a170903024500b001a637a6f41amr6683223plh.45.1682704537384; Fri, 28 Apr 2023 10:55:37 -0700 (PDT) Received: from localhost ([135.180.227.0]) by smtp.gmail.com with ESMTPSA id u4-20020a170902b28400b001a64851087bsm13520126plr.272.2023.04.28.10.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 10:55:36 -0700 (PDT) Subject: [PATCH] Revert "riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC." Date: Fri, 28 Apr 2023 10:54:59 -0700 Message-Id: <20230428175458.4768-1-palmer@rivosinc.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: libc-alpha@sourceware.org, Palmer Dabbelt From: Palmer Dabbelt To: joseph@codesourcery.com X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: 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. --- 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 medium. @node RISC-V @appendixsec RISC-V-specific Facilities -Functions that are lazily bound must be compatible with the standard calling -convention. When a function is annotated with STO_RISCV_VARIANT_CC, it means -this function is not compatible with the standard calling convention. The -dynamic linker will directly resolve it instead of using the lazy binding -mechanism. - Cache management facilities specific to RISC-V systems that implement the 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 == 64 && (type) == R_RISCV_TLS_TPREL64))) \ | (ELF_RTYPE_CLASS_COPY * ((type) == R_RISCV_COPY))) -//* Translate a processor specific dynamic tag to the index in l_info array. */ -#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 == R_RISCV_JUMP_SLOT)) { - if (__glibc_unlikely (map->l_info[DT_RISCV (VARIANT_CC)] != NULL)) - { - /* Check the symbol table for variant CC symbols. */ - const Elf_Symndx symndx = ELFW(R_SYM) (reloc->r_info); - const ElfW(Sym) *symtab = - (const void *)D_PTR (map, l_info[DT_SYMTAB]); - const ElfW(Sym) *sym = &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 = NULL; - if (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL) - { - const ElfW(Half) *vernum = - (const void *)D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]); - version = &map->l_versions[vernum[symndx] & 0x7fff]; - } - elf_machine_rela (map, scope, reloc, sym, version, reloc_addr, - skip_ifunc); - return; - } - } - if (__glibc_unlikely (map->l_mach.plt == 0)) { if (l_addr) -- 2.40.0