[PATCH v2] x86-64: Relax BFD_RELOC_X86_64_GOTTPOFF check
Jan Beulich
jbeulich@suse.com
Mon Jul 1 08:08:42 GMT 2024
On 01.07.2024 09:21, Kong, Lingling wrote:
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@suse.com>
>> Sent: Monday, July 1, 2024 2:15 PM
>> To: Kong, Lingling <lingling.kong@intel.com>
>> Cc: H. J. Lu <hjl.tools@gmail.com>; binutils@sourceware.org
>> Subject: Re: [PATCH v2] x86-64: Relax BFD_RELOC_X86_64_GOTTPOFF check
>>
>> On 01.07.2024 05:03, Kong, Lingling wrote:
>>> --- a/gas/config/tc-i386.c
>>> +++ b/gas/config/tc-i386.c
>>> @@ -7137,8 +7137,14 @@ md_assemble (char *line)
>>> && i.base_reg
>>> && i.base_reg->reg_num == RegIP
>>> && i.tm.operand_types[0].bitfield.class == Reg
>>> - && i.tm.operand_types[2].bitfield.class == Reg)
>>> - /* Allow APX: add %reg1, foo@gottpoff(%rip), %reg2. */
>>> + && (i.tm.operand_types[2].bitfield.class == Reg
>>> + || i.tm.operands == 2))
>>
>> As before: You allow more than what you claim in the comment below, unless I
>> continue to be overlooking something: Aiui you want to exclude forms with
>> memory destination.
>>
>>> + /* Allow APX:
>>> + add %reg1, foo@gottpoff(%rip), %reg2
>>> + add foo@gottpoff(%rip), %reg, %reg2
>>> + {nf} add foo@gottpoff(%rip), %reg
>>> + {nf} add %reg1, foo@gottpoff(%rip), %reg2
>>> + {nf} add foo@gottpoff(%rip), %reg, %reg2.
>>> + */
>>> break;
>>
>> I don't think the {nf} forms need naming specially. Or if they did, I wouldn't see -
>> as mentioned before - why the {evex} forms won't need/want mentioning, too.
>>
>> From the presentation below one can get the impression that you're altering
>> indentation of the comment. It was properly indented though.
>> However, your patch also pretty clearly came through with corrupted whitespace
>> (no hard tabs at all), so it's not really clear what changes.
>
> Sorry for my corrupted whitespace, there was a problem with the format of my email, so I re-sent the attachment. This version only modified the comment part, and the rest remained unchanged.
Thanks. Formatting there indeed looks okay.
> For such TLS sequences, it should only generated by compiler like GCC or LLVM not handwritten assembly codes.
Who or what says that hand-written assembly isn't permitted here? Who
or what says that compilers will only ever emit correct sequences? See
my earlier question to H.J. (which sadly has been left without actual
answer) - imo this either wants making as strict as possible or as
relaxed as possible. Anything in the middle is going to be entirely
arbitrary, and would hence need to come with a good explanation of why
exactly it is done like this.
Jan
More information about the Binutils
mailing list