mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
Revert "riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC."
This reverts commit 117e8b341c
.
Reason for revert: Causes elf/tst-glibcelf and elf/tst-relro-*
to fail on all architectures.
This commit is contained in:
@@ -3933,13 +3933,6 @@ enum
|
|||||||
|
|
||||||
#define R_TILEGX_NUM 130
|
#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 */
|
/* RISC-V ELF Flags */
|
||||||
#define EF_RISCV_RVC 0x0001
|
#define EF_RISCV_RVC 0x0001
|
||||||
#define EF_RISCV_FLOAT_ABI 0x0006
|
#define EF_RISCV_FLOAT_ABI 0x0006
|
||||||
|
@@ -121,12 +121,6 @@ when it is not allowed, the priority is set to medium.
|
|||||||
@node RISC-V
|
@node RISC-V
|
||||||
@appendixsec RISC-V-specific Facilities
|
@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
|
Cache management facilities specific to RISC-V systems that implement the Linux
|
||||||
ABI are declared in @file{sys/cachectl.h}.
|
ABI are declared in @file{sys/cachectl.h}.
|
||||||
|
|
||||||
|
@@ -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
|
|
||||||
<https://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
/* Number of extra dynamic section entries for this architecture. By
|
|
||||||
default there are none. */
|
|
||||||
#define DT_THISPROCNUM DT_RISCV_NUM
|
|
@@ -53,9 +53,6 @@
|
|||||||
|| (__WORDSIZE == 64 && (type) == R_RISCV_TLS_TPREL64))) \
|
|| (__WORDSIZE == 64 && (type) == R_RISCV_TLS_TPREL64))) \
|
||||||
| (ELF_RTYPE_CLASS_COPY * ((type) == R_RISCV_COPY)))
|
| (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. */
|
/* Return nonzero iff ELF header is compatible with the running host. */
|
||||||
static inline int __attribute_used__
|
static inline int __attribute_used__
|
||||||
elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
|
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. */
|
/* Check for unexpected PLT reloc type. */
|
||||||
if (__glibc_likely (r_type == R_RISCV_JUMP_SLOT))
|
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 (__glibc_unlikely (map->l_mach.plt == 0))
|
||||||
{
|
{
|
||||||
if (l_addr)
|
if (l_addr)
|
||||||
|
Reference in New Issue
Block a user