public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: Kuan-Lin Chen <kuanlinchentw@gmail.com>
Cc: Nelson Chu <nelson.chu@sifive.com>, Jim Wilson <jimw@sifive.com>,
		Palmer Dabbelt <palmerdabbelt@google.com>,
		"binutils@sourceware.org Development" <binutils@sourceware.org>
Subject: Re: [PATCH] [RISCV] Support subtraction of .uleb128.
Date: Mon, 06 Jan 2020 08:37:00 -0000	[thread overview]
Message-ID: <CA+yXCZAJeyexUno3ooo+mgirM88sS2Nm8N9-sxe5w3we9gYrpg@mail.gmail.com> (raw)
In-Reply-To: <CAJr6u0i+b4AmyWCJ-ke1NMziFFX7fTZN+E35yq+eKg5PbxbC5g@mail.gmail.com>

Hi Kuan-Lin:

> * testsuite/ld-riscv-elf/uleb128.d: New test.
> * testsuite/ld-riscv-elf/uleb128.s: New file.
Those two files are not included in the patch, maybe you forgot add?

On Mon, Jan 6, 2020 at 4:18 PM Kuan-Lin Chen <kuanlinchentw@gmail.com>
wrote:

> Hi,
>
> The patch is fixed some problems as your comments in previous mails.
>
> >The assumption that the uleb128 address size can only decrease with
> relaxation is true only if both addresses are in the same section.
> I found this kind of subtract is banned in cvt_frag_to_fill for
> rs_leb128.  Therefore, it doesn't have to restrict by ourselves.
>
> Thanks for your reviews.
>
> Nelson Chu <nelson.chu@sifive.com> 於 2019年12月18日 週三 上午9:50寫道:
> >
> > There is one minor thing.  Maciej has pointed out before that it's
> > better done with one the percent-codes to `_bfd_error_handler' rather
> > than aborting the link right away, so that any further link errors are
> > also reported and you don't have to shake them out one by one.  So
> > report the relocation error via linker's callback function seems to be
> > better.  I think maybe we can report a dangerous relocation for the
> > mismatched R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128.  What I meant
> > is that,
> >
> > + case R_RISCV_SET_ULEB128:
> > ...
> > +  else
> > +    {
> > +      if (uleb128_rel->r_offset != rel->r_offset)
> > + {
> > -  (*_bfd_error_handler) (_("%pB: relocation %s mismatched. "),
> > - input_bfd, howto->name);
> > -  bfd_set_error (bfd_error_bad_value);
> > + msg = ("R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128 are mismatched. ");
> > + r = bfd_reloc_dangerous;
> > + break;
> > + }
> > +      relocation = relocation - uleb128_vma;
> > +      uleb128_rel = NULL;
> > +      break;
> > +    }
> > +
> > + case R_RISCV_SUB_ULEB128:
> > +  if (uleb128_rel)
> > +    {
> > +      if (uleb128_rel->r_offset != rel->r_offset)
> > + {
> > -  (*_bfd_error_handler) (_("%pB: relocation %s mismatched. "),
> > - input_bfd, howto->name);
> > -  bfd_set_error (bfd_error_bad_value);
> > + msg = ("R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128 are mismatched. ");
> > + r = bfd_reloc_dangerous;
> > + break;
> > + }
> > +      relocation = uleb128_vma - relocation;
> > +      uleb128_rel = NULL;
> > +      break;
> > +    }
> >
> > Thanks and regards
> > Nelson
>
>
>
> --
> Best regards,
> Kuan-Lin Chen.
> kuanlinchentw@gmail.com
>

  reply	other threads:[~2020-01-06  8:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27  8:12 Kuan-Lin Chen
2019-11-27 10:36 ` Andreas Schwab
2019-12-02  1:18   ` Kuan-Lin Chen
2019-12-02 22:27 ` Jim Wilson
2019-12-06 23:48 ` Palmer Dabbelt via binutils
2019-12-10  5:43   ` Kuan-Lin Chen
2019-12-17 23:59     ` Jim Wilson
2019-12-18  1:50       ` Nelson Chu
2020-01-06  8:18         ` Kuan-Lin Chen
2020-01-06  8:37           ` Kito Cheng [this message]
2020-01-06  8:44           ` Kuan-Lin Chen
2020-01-09 23:20   ` Palmer Dabbelt via binutils
2020-01-22  7:26     ` Kuan-Lin Chen
2020-09-25  7:14       ` Kito Cheng
2020-09-25 15:55         ` Jozef Lawrynowicz
2020-09-01 12:56 Jozef Lawrynowicz
2020-09-02  1:29 ` Kuan-Lin Chen

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=CA+yXCZAJeyexUno3ooo+mgirM88sS2Nm8N9-sxe5w3we9gYrpg@mail.gmail.com \
    --to=kito.cheng@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jimw@sifive.com \
    --cc=kuanlinchentw@gmail.com \
    --cc=nelson.chu@sifive.com \
    --cc=palmerdabbelt@google.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).