From: Jan Beulich <jbeulich@suse.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH 4/5] x86-64: further tighten convert-load-reloc checking
Date: Tue, 4 Feb 2025 11:17:26 +0100 [thread overview]
Message-ID: <82382f26-e3ce-4267-a949-139a062f3f8f@suse.com> (raw)
In-Reply-To: <CAMe9rOqES_gKT-uSD0QFChWbO9GkZcCXq2zt3qX1jOx27Uav-g@mail.gmail.com>
On 04.02.2025 11:10, H.J. Lu wrote:
> On Tue, Feb 4, 2025 at 6:04 PM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 03.02.2025 23:41, H.J. Lu wrote:
>>> On Mon, Feb 3, 2025 at 7:41 PM Jan Beulich <jbeulich@suse.com> wrote:
>>>>
>>>> REX2.M affects what insn we're actually dealing with, so we better check
>>>> this to avoid transforming (future) insns we must not touch.
>>>>
>>>> --- a/bfd/elf64-x86-64.c
>>>> +++ b/bfd/elf64-x86-64.c
>>>> @@ -2282,14 +2282,14 @@ elf_x86_64_convert_load_reloc (bfd *abfd
>>>> if (to_reloc_pc32)
>>>> return true;
>>>>
>>>> - if (opcode == 0x85)
>>>> + if (opcode == 0x85 && !(rex2 & (REX2_M << 4)))
>>>> {
>>>> /* Convert "test %reg, foo@GOTPCREL(%rip)" to
>>>> "test $foo, %reg". */
>>>> modrm = 0xc0 | (modrm & 0x38) >> 3;
>>>> opcode = 0xf7;
>>>> }
>>>> - else if ((opcode | 0x38) == 0x3b)
>>>> + else if ((opcode | 0x38) == 0x3b && !(rex2 & (REX2_M << 4)))
>>>> {
>>>> /* Convert "binop foo@GOTPCREL(%rip), %reg" to
>>>> "binop $foo, %reg". */
>>>>
>>>
>>> Please add a testcase to show it makes a difference.
>>
>> Hmm, not sure how such a testcase would look like. At least some of
>> the involved opcodes have no meaning (yet) with REX2. But maybe I
>> can construct something. Still I view it as unreasonable that such
>> obvious omissions in earlier changes can't be corrected without
>> investing a lot of time in trying to make up a situation where
>> things would fail. Once again: Proof of _no failure_ should have
>> been added when these optimizations were introduced. And that proof
>> should have been extended when APX support was added. What you're
>> effectively doing is to ask me to cover for earlier omissions.
>
> Again. No test, no issue, no change.
Again - please adjust your attitude.
Jan
next prev parent reply other threads:[~2025-02-04 10:17 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 11:39 [PATCH 0/5] x86: further GOT{,PCREL} related adjustments Jan Beulich
2025-02-03 11:40 ` [PATCH 1/5] x86: drop redundant i.operands checks from output_disp() Jan Beulich
2025-02-03 11:40 ` [PATCH 2/5] ix86: tighten convert-load-reloc checking Jan Beulich
2025-02-03 22:34 ` H.J. Lu
2025-02-04 7:21 ` Jan Beulich
2025-02-04 7:26 ` H.J. Lu
2025-02-04 7:58 ` Jan Beulich
2025-02-04 8:03 ` H.J. Lu
2025-02-04 8:10 ` Jan Beulich
2025-02-03 11:41 ` [PATCH 3/5] x86: widen @got{,pcrel} support to PUSH and APX IMUL Jan Beulich
2025-02-03 22:40 ` H.J. Lu
2025-02-04 10:14 ` Jan Beulich
2025-02-04 10:17 ` H.J. Lu
2025-02-04 10:41 ` Jan Beulich
2025-02-04 11:02 ` H.J. Lu
2025-02-04 11:02 ` Jan Beulich
2025-02-04 11:12 ` H.J. Lu
2025-02-04 11:16 ` Jan Beulich
2025-02-04 12:14 ` H.J. Lu
2025-02-05 11:37 ` Jan Beulich
2025-02-06 2:28 ` H.J. Lu
2025-02-06 12:08 ` Jan Beulich
2025-02-07 5:27 ` H.J. Lu
2025-02-03 11:41 ` [PATCH 4/5] x86-64: further tighten convert-load-reloc checking Jan Beulich
2025-02-03 22:41 ` H.J. Lu
2025-02-04 10:04 ` Jan Beulich
2025-02-04 10:10 ` H.J. Lu
2025-02-04 10:17 ` Jan Beulich [this message]
2025-02-03 11:42 ` [PATCH 5/5] ix86: restrict use of GOT32X relocs Jan Beulich
2025-02-03 22:41 ` H.J. Lu
2025-02-04 7:24 ` Jan Beulich
2025-02-04 7:27 ` H.J. Lu
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=82382f26-e3ce-4267-a949-139a062f3f8f@suse.com \
--to=jbeulich@suse.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.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).