Re: [PATCH] MIPS: tools: relocs: Ship a definition of R_MIPS_PC32

From: Ard Biesheuvel

Date: Mon Feb 02 2026 - 04:19:44 EST



On Mon, 2 Feb 2026, at 05:16, Yao Zi wrote:
> R_MIPS_PC32 is a GNU extension, its definition is available in glibc
> only since 2.39 (released in 2024), and not available in musl libc yet.
> Provide our own definition for R_MIPS_PC32 and use it if necessary to
> fix relocs tool building on musl and older glibc systems.
>
> Fixes: ff79d31eb536 ("mips: Add support for PC32 relocations in vmlinux")
> Signed-off-by: Yao Zi <me@xxxxxxxx>

Thanks for fixing this.

It does imply that the subsequent kallsyms patch will result in 32-bit MIPS no longer being buildable with older toolchains if CONFIG_RELOCATABLE=y.

Not sure if that is an issue, but it needs calling out. Nathan, any thoughts?

> ---
> arch/mips/boot/tools/relocs.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/mips/boot/tools/relocs.h b/arch/mips/boot/tools/relocs.h
> index 607ff0103064..942981d9ce73 100644
> --- a/arch/mips/boot/tools/relocs.h
> +++ b/arch/mips/boot/tools/relocs.h
> @@ -29,6 +29,13 @@ void die(char *fmt, ...);
> #define R_MIPS_PC26_S2 61
> #endif
>
> +/*
> + * GNU extension that available in glibc only since 2023, not
> available on musl.
> + */
> +#ifndef R_MIPS_PC32
> +#define R_MIPS_PC32 248
> +#endif
> +
> #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
>
> enum symtype {
> --
> 2.52.0