lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <aeca11fb-aa31-4fb2-b937-189626a81f81@app.fastmail.com>
Date: Tue, 03 Feb 2026 13:31:48 +0100
From: "Ard Biesheuvel" <ardb@...nel.org>
To: "Yao Zi" <me@...ao.cc>, "Nathan Chancellor" <nathan@...nel.org>
Cc: "Thomas Bogendoerfer" <tsbogend@...ha.franken.de>,
 linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] MIPS: tools: relocs: Ship a definition of R_MIPS_PC32



On Tue, 3 Feb 2026, at 04:56, Yao Zi wrote:
> On Mon, Feb 02, 2026 at 04:07:29PM -0700, Nathan Chancellor wrote:
>> On Mon, Feb 02, 2026 at 10:17:53AM +0100, Ard Biesheuvel wrote:
>> > 
>> > 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@...ao.cc>
>> > 
>> > 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.
>> 
>> Doing a little research, it seems like R_MIPS_PC32 has been recognized
>> by the toolchains for a long time, as I found these commits in binutils:
>> 
>>   https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=092dcd755dcdcf664b25a7011fd15957f124c29f
>>   https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b47468a6dbd1b54c44c2edc0f7db64a073d894ea
>> 
>> It seems like this relocation was not documented in glibc until
>> recently, along with many other relocation types:
>> 
>>   https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a6e8ceb3bb532236e1eecd0bb0ee8e4b7fd5ff7c
>> 
>> I interpret that to mean that the kallsyms patch should work fine since
>> the toolchain can handle these relocations? It is just building the
>> relocs tool against an older glibc or musl that does not have the
>> R_MIPS_PC32 definition that is broken? Or am I misunderstanding
>> something?
>
> Yes, this patch is only meant to fix building of relocs tool. I don't
> think there are problems about toolchain supporting since R_MIPS_PC32
> has been in binutils for a long time, as Nathan found, since 2004. The
> situation is that it's likely to have a toolchain supporting
> R_MIPS_PC32, while elf.h on the build machine doesn't have its
> definition. And after ff79d31eb536 ("mips: Add support for PC32
> relocations in vmlinux"), the relocs tool started to require a
> definition of R_MIPS_PC32 to build.
>

OK, thanks for the clarification.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ