public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Jinyang He <hejinyang@loongson.cn>
Cc: mengqinggang <mengqinggang@loongson.cn>,
	binutils@sourceware.org, Xing Li <lixing@loongson.cn>,
	Xi Ruoyao <xry111@xry111.site>, Alan Modra <amodra@gmail.com>
Subject: Re: [PATCH] Make sure DW_CFA_advance_loc4 is in the same frag
Date: Wed, 30 Aug 2023 08:28:56 +0200	[thread overview]
Message-ID: <3ececcbb-8ddf-bc8c-23ec-5c13c86c9a1b@suse.com> (raw)
In-Reply-To: <fa141a0a-1b11-9c52-2e8a-bcf641942522@loongson.cn>

On 30.08.2023 05:35, Jinyang He wrote:
> How about this patch state?

As said before, Alan approved your change, so you're okay to commit. In
the subsequent discussion he explained to me why what I was suggesting
wasn't really correct.

Jan

> On 2023-08-11 18:15, Alan Modra wrote:
>> On Fri, Aug 11, 2023 at 10:27:53AM +0200, Jan Beulich wrote:
>>> On 11.08.2023 01:02, Alan Modra wrote:
>>>> On Thu, Aug 10, 2023 at 02:55:20PM +0200, Jan Beulich wrote:
>>>>> On 10.08.2023 14:36, Jinyang He wrote:
>>>>>> On /Thu Aug 10 07:55:58 GMT 2023 /Jan Beulich wrote:
>>>>>>
>>>>>>> On 10.08.2023 04:21, Jinyang He wrote:
>>>>>>>> /The DW_CFA_advance_loc4 may be in different frags. Then fr_fix />/may caused something wrong. Referenced by commit b9d8f5601bcf />/("Re: Optimise away eh_frame advance_loc 0"). /
>>>>>>> I'm afraid I don't understand that earlier fix: frag_more(1) there
>>>>>>> ought to guarantee fr_fix (once the frag is closed) to be >= 1.
>>>>>>> It would then seem to me that ...
>>>>>> I'm not familiar with it. Please point out my mistakes. Thanks in advance.
>>>>> Well, Alan has approved your change. Maybe it's me who is wrong here.
>>>> The idea behind commit b9d8f5601bcf was that when a
>>>> DW_CFA_advance_loc4 of zero is seen in eh_frame_relax_frag and
>>>> eh_frame_convert_frag we want to remove the opcode entirely, not just
>>>> convert to a nop.  If the opcode was split over two frags then the
>>>> size adjustment would need to be done to the first frag, not the
>>>> second as is correct for other cases with split frags.  This would
>>>> complicate the eh relaxation.  It's easier to ensure the frag is not
>>>> split.
>>> Oh, right, I can see that this makes things easier. But for the change
>>> here, does frag_grow() actually help preventing the split?
>> Yes.
>>
>>> Wouldn't it
>>> need to be yet beyond what I suggested and require frag_more(5),
>> No, because frag_more would move the obstack data pointer, and we want
>> to leave that to the caller of check_eh_frame.
>>
>>> such
>>> that intermediate section switches wouldn't close off the first frag?
>> That shouldn't happen.  check_eh_frame only does something when
>> processing .eh_frame or .debug_frame sections.
>>
>>> Of course this would collide with what you say regarding size
>>> adjustments needing to happen on the 2nd (variable) frag. (Aiui just
>>> frag_grow() is enough in output_cfi_insn(), as there we aren't at risk
>>> of intermediate section changes.)
>>>
>>> Jan
> 


  reply	other threads:[~2023-08-30  6:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ab826dcb-6969-a980-889a-6958b60a4b48@loongson.cn>
2023-08-10 12:36 ` Jinyang He
2023-08-10 12:55   ` Jan Beulich
2023-08-10 23:02     ` Alan Modra
2023-08-11  8:27       ` Jan Beulich
2023-08-11 10:15         ` Alan Modra
2023-08-30  3:35           ` Jinyang He
2023-08-30  6:28             ` Jan Beulich [this message]
2023-09-08 23:46               ` Alan Modra
2023-08-10  2:21 Jinyang He
2023-08-10  7:51 ` Alan Modra
2023-08-10  7:55 ` Jan Beulich

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=3ececcbb-8ddf-bc8c-23ec-5c13c86c9a1b@suse.com \
    --to=jbeulich@suse.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=hejinyang@loongson.cn \
    --cc=lixing@loongson.cn \
    --cc=mengqinggang@loongson.cn \
    --cc=xry111@xry111.site \
    /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).