public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@dabbelt.com>
To: binutils@sourceware.org
Cc: Kito Cheng <kito.cheng@gmail.com>,
	Patrick O'Neill <patrick@rivosinc.com>,
	 binutils@sourceware.org, gnu-toolchain@rivosinc.com
Subject: Re: [PATCH 0/4] RISCV: Improve linker time complexity
Date: Wed, 13 Apr 2022 11:11:31 -0700 (PDT)	[thread overview]
Message-ID: <mhng-c402eb04-240a-4f39-9868-54b1b8102391@palmer-ri-x1c9> (raw)
In-Reply-To: <YlZbtq9Uf8QzqqBK@squeak.grove.modra.org>

On Tue, 12 Apr 2022 22:12:22 PDT (-0700), binutils@sourceware.org wrote:
> On Wed, Apr 13, 2022 at 08:58:38AM +0800, Kito Cheng via Binutils wrote:
>> And I have a suggestion here is - does it possible to let co-exist with current
>> implementation and having a command line option to select the linker
>> relaxation, of course we
>> could default to using the new implementation, but that gives us an
>> emergency fallback option to use the old implementation :)
>
> You already have an emergency fallback, use an older binutils or
> revert the patchset.  IMO you do not want two implementations of any
> given feature.   Doing so just makes it more likely that neither
> implementation is good.

IMO a key point here is that the hueristics are subtly different, the 
linear-time algorithm will fail at both forwards and backwards targets 
where relaxation enables relaxation (as opposed to just failing at the 
forwards targets, like the old one did).  The theory is that there 
aren't any pathological cases in the wild, but it's hard to know for 
sure.  I think it should just be a few lines of code to match the old 
behavior (ie, just eagerly delete instead of deferring it to after all 
relocations are processed), but I'm not sure -- the change around 
alignment handling is tripping me up, as that was unexpected on my end.

That said, there's certainly enough complexity here so I don't think 
it's a big deal to just only support the new flavor.

  reply	other threads:[~2022-04-13 18:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 16:25 Patrick O'Neill
2022-04-12 16:25 ` [PATCH 1/4] RISCV: Add linker relaxation tests Patrick O'Neill
2022-04-12 16:25 ` [PATCH 2/4] RISCV: Arrange DELETE pass after .align pass Patrick O'Neill
2022-04-12 16:26 ` [PATCH 3/4] RISCV: Implement piecewise deletion Patrick O'Neill
2022-04-12 16:26 ` [PATCH 4/4] RISCV: Improve runtime of align directives Patrick O'Neill
2022-04-13  0:58 ` [PATCH 0/4] RISCV: Improve linker time complexity Kito Cheng
2022-04-13  2:23   ` Palmer Dabbelt
2022-04-13  5:12   ` Alan Modra
2022-04-13 18:11     ` Palmer Dabbelt [this message]
2022-04-25 17:26       ` Patrick O'Neill
2022-05-02 13:50 ` [PATCH v2 0/5] " Patrick O'Neill
2022-05-02 13:50   ` [PATCH v2 1/5] RISCV: Add linker relaxation tests Patrick O'Neill
2022-05-02 13:50   ` [PATCH v2 2/5] RISCV: Arrange DELETE pass after .align pass Patrick O'Neill
2022-05-02 13:50   ` [PATCH v2 3/5] RISCV: Implement piecewise deletion Patrick O'Neill
2022-05-20 10:48     ` Nelson Chu
2022-05-20 17:36       ` Patrick O'Neill
2022-05-02 13:50   ` [PATCH v2 4/5] RISCV: Improve runtime of align directives Patrick O'Neill
2022-05-02 13:50   ` [PATCH v2 5/5] RISCV: Add --defer-deletion flag Patrick O'Neill
2022-05-27 21:20   ` [PATCH v3 0/3] RISCV: Improve linker time complexity Patrick O'Neill
2022-05-27 21:20     ` [PATCH v3 1/3] RISCV: Add linker relaxation tests Patrick O'Neill
2022-05-27 21:20     ` [PATCH v3 2/3] RISCV: Implement piecewise deletion Patrick O'Neill
2022-05-27 21:20     ` [PATCH v3 3/3] RISCV: Add --defer-deletion flag Patrick O'Neill

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=mhng-c402eb04-240a-4f39-9868-54b1b8102391@palmer-ri-x1c9 \
    --to=palmer@dabbelt.com \
    --cc=binutils@sourceware.org \
    --cc=gnu-toolchain@rivosinc.com \
    --cc=kito.cheng@gmail.com \
    --cc=patrick@rivosinc.com \
    /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).