public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Joseph Myers <joseph@codesourcery.com>
Cc: caiyinyu <caiyinyu@loongson.cn>,
	xuchenghua@loongson.cn,  i.swmail@xen0n.name,
	libc-alpha@sourceware.org
Subject: Re: [PATCH 1/1] LoongArch: Add pointer mangling support.
Date: Wed, 17 Aug 2022 15:43:59 +0800	[thread overview]
Message-ID: <fd49fa7ebb19bd001a859c77b934ece3d47aee04.camel@xry111.site> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2208161522050.369967@digraph.polyomino.org.uk>

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

  reply	other threads:[~2022-08-17  7:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11  4:00 caiyinyu
2022-08-15 20:52 ` Joseph Myers
2022-08-16  1:30   ` Xi Ruoyao
2022-08-16  1:59     ` Xi Ruoyao
2022-08-16 15:23       ` Joseph Myers
2022-08-17  7:43         ` Xi Ruoyao [this message]
2022-08-17 16:46           ` Joseph Myers
2022-08-19 13:46             ` Xi Ruoyao
2022-08-21  7:25               ` caiyinyu
2022-08-18  2:25           ` caiyinyu
2022-08-16  1:28 ` Xi Ruoyao
2022-08-16  6:34   ` caiyinyu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd49fa7ebb19bd001a859c77b934ece3d47aee04.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=caiyinyu@loongson.cn \
    --cc=i.swmail@xen0n.name \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=xuchenghua@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).