https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102952
--- Comment #10 from peterz at infradead dot org ---
(In reply to H.J. Lu from comment #4)
> Created attachment 51679 [details]
> A patch to add -mindirect-branch-cs-prefix
>
> It adds CS prefix to call and jmp to thunk when converting indirect call
> and jump.
This seems to work as expected, I get CS prefix on all high reg thunk calls and
no CS prefix on the low reg calls. Example:
29241: e8 00 00 00 00 call 29246 <intel_dsc_enable.cold+0x6e5>
29242: R_X86_64_PLT32 __x86_indirect_thunk_rax-0x4
292c8: 2e e8 00 00 00 00 cs call 292ce
<intel_dsc_enable.cold+0x76d> 292ca: R_X86_64_PLT32
__x86_indirect_thunk_r10-0x4