[PATCH v3] RISC-V: Fix IFUNC resolver cannot access gp pointer

Andreas Schwab schwab@suse.de
Mon Feb 24 11:29:50 GMT 2025


On Nov 27 2024, Yangyu Chen wrote:

> diff --git a/sysdeps/riscv/dl-machine.h b/sysdeps/riscv/dl-machine.h
> index b2f28697f7..b10b2eb909 100644
> --- a/sysdeps/riscv/dl-machine.h
> +++ b/sysdeps/riscv/dl-machine.h
> @@ -348,7 +348,8 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
>        gotplt[1] = (ElfW(Addr)) l;
>      }
>  
> -  if (l->l_type == lt_executable && l->l_relocated)
> +#ifdef SHARED
> +  if (l->l_type == lt_executable && l->l_scope != NULL)

I don't think l_scope can ever be NULL.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


More information about the Libc-alpha mailing list