No subject
Wed Sep 18 12:45:02 AEST 2024
The descriptors it's talking about are the OPD function descriptors used
on ABI v1 (big endian).
> But it is exactly the same for VDSO32 functions, allthough they are
> flagged as functions.
It's not quite the same because of the function descriptors.
On ppc64/ABIv1 a function pointer for "F" points to an opd, which then
points to ".F" which has the actual text. It's the ".F" symbol that has
type "function".
> So lets flag them as functions and revert the selftest change.
>
> What's your opinion on that ?
I think it's fine on ppc64le, I worry slightly that it risks breaking
glibc or something else on big endian.
It is more correct for the text symbol to have type function, even if
there's no function descriptor for it.
glibc has a special case already for handling the VDSO symbols which
creates a fake opd pointing at the kernel symbol. So changing the VDSO
symbol type to function shouldn't affect that AFAICS.
I think the only cause of breakage would be if something is explicitly
looking for NOTYPE symbols, which seems unlikely, but you never know.
So I think we could attempt to take this change for v6.13, giving it
lots of time to get some test coverage in next before going to mainline.
cheers
> It predates git kernel history and both VDSO32 and VDSO64 were brough by
> arch/ppc64/ with that difference already.
>
> Signed-off-by: Christophe Leroy <christophe.leroy at csgroup.eu>
> ---
> commit ba83b3239e65 is in random git tree at the moment : https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git/commit/?id=ba83b3239e657469709d15dcea5f9b65bf9dbf34
> On the list at : https://lore.kernel.org/lkml/fc1a0862516b1e11b336d409f2cb8aab10a97337.1725020674.git.christophe.leroy@csgroup.eu/T/#u
> ---
> arch/powerpc/include/asm/vdso.h | 1 +
> tools/testing/selftests/vDSO/parse_vdso.c | 3 +--
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h
> index 7650b6ce14c8..8d972bc98b55 100644
> --- a/arch/powerpc/include/asm/vdso.h
> +++ b/arch/powerpc/include/asm/vdso.h
> @@ -25,6 +25,7 @@ int vdso_getcpu_init(void);
> #ifdef __VDSO64__
> #define V_FUNCTION_BEGIN(name) \
> .globl name; \
> + .type name, at function; \
> name: \
>
> #define V_FUNCTION_END(name) \
> diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c
> index d9ccc5acac18..4ae417372e9e 100644
> --- a/tools/testing/selftests/vDSO/parse_vdso.c
> +++ b/tools/testing/selftests/vDSO/parse_vdso.c
> @@ -216,8 +216,7 @@ void *vdso_sym(const char *version, const char *name)
> ELF(Sym) *sym = &vdso_info.symtab[chain];
>
> /* Check for a defined global or weak function w/ right name. */
> - if (ELF64_ST_TYPE(sym->st_info) != STT_FUNC &&
> - ELF64_ST_TYPE(sym->st_info) != STT_NOTYPE)
> + if (ELF64_ST_TYPE(sym->st_info) != STT_FUNC)
> continue;
> if (ELF64_ST_BIND(sym->st_info) != STB_GLOBAL &&
> ELF64_ST_BIND(sym->st_info) != STB_WEAK)
> --
> 2.44.0
More information about the Linuxppc-dev
mailing list