[PATCH 1/1] LoongArch: Add pointer mangling support.
Xi Ruoyao
xry111@xry111.site
Wed Aug 17 07:43:59 GMT 2022
On Tue, 2022-08-16 at 15:23 +0000, Joseph Myers wrote:
> > > No, we must use Binutils-2.40 for new relocation types like %pc_hi20.
> > > Maybe we can add a configure check to fallback to "la.pcrel"/"la.got"
> > > macros for Binutils <= 2.39.
> >
> > Hmm... AFAIK our ld.so is already broken with Binutils <= 2.39, so
> > perhaps we should just claim Binutils <= 2.39 are not supported.
>
> Requiring unreleased versions is bad for users and distributors; it would
> be better to backport whatever binutils patches are required to 2.39
> branch (assuming they are LoongArch-specific patches, rather than changes
> to architecture-independent parts of binutils that are risky for other
> architectures) and add configure tests to work around any that don't get
> backported.
I share your feeling... But the fix needed by ld.so (bc2a35c in
binutils-gdb.git) is after two commits massively changing the relocation
types. Backporting the relocation type changes is completely
unacceptable (such an attempt will do nothing except annoying Nick
Clifton :). And bc2a35c alone cannot be backported trivially.
I've published a separate version of bc2a35c as the attachment of
https://sourceware.org/pipermail/libc-alpha/2022-July/140949.html, but
it's not a trivial backport: I had to change some code where bc2a35a
does not change or the path for "old" relocation types would just
overflow the heap buffer and corrupt the heap. And my backport is not
reviewed or tested carefully.
P. S. Currently building Glibc requires Binutils >= 2.40, but building
the kernel modules requires Binutils <= 2.39. This effectively forces
every LoongArch distribution to ship two toolchains :(. I hope we can
end this madness soon.
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
More information about the Libc-alpha
mailing list