Re: [PATCH] x86: Disable sibcall if indirect_return attribute doesn't match

2022-07-14 Thread Hongtao Liu via Gcc-patches
On Fri, Jul 15, 2022 at 1:44 AM H.J. Lu via Gcc-patches wrote: > > When shadow stack is enabled, function with indirect_return attribute > may return via indirect jump. In this case, we need to disable sibcall > if caller doesn't have indirect_return attribute and indirect branch > tracking is

[PATCH] x86: Disable sibcall if indirect_return attribute doesn't match

2022-07-14 Thread H.J. Lu via Gcc-patches
When shadow stack is enabled, function with indirect_return attribute may return via indirect jump. In this case, we need to disable sibcall if caller doesn't have indirect_return attribute and indirect branch tracking is enabled since compiler won't generate ENDBR when calling the caller. gcc/