Re: -fpatchable-function-entry: leverage multi-byte NOP on x86

2020-01-06 Thread Alexander Monakov
On Mon, 6 Jan 2020, Martin Liška wrote: > You are right, we do not leverage multi-byte NOPs. Note that the support > depends > on a CPU model (-march) and the similar code is quite complex in binutils: > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gas/config/tc-i386.c;h=d0b8f

Re: -fpatchable-function-entry: leverage multi-byte NOP on x86

2020-01-06 Thread Martin Liška
On 1/4/20 9:48 PM, Fangrui Song wrote: -fpatchable-function-entry is used by Linux kernel arm64/parisc. The feature works for x86, but does not leverage multi-byte NOP. % cat a.c int foo() { return 0; } % gcc -fpatchable-function-entry=5,0 -c a.c % objdump -d a.o ... :    0:  

Re: -fpatchable-function-entry: leverage multi-byte NOP on x86

2020-01-06 Thread Fangrui Song
On 2020-01-04, Fangrui Song wrote: -fpatchable-function-entry is used by Linux kernel arm64/parisc. The feature works for x86, but does not leverage multi-byte NOP. % cat a.c int foo() { return 0; } % gcc -fpatchable-function-entry=5,0 -c a.c % objdump -d a.o ... : 0: 90

-fpatchable-function-entry: leverage multi-byte NOP on x86

2020-01-04 Thread Fangrui Song
-fpatchable-function-entry is used by Linux kernel arm64/parisc. The feature works for x86, but does not leverage multi-byte NOP. % cat a.c int foo() { return 0; } % gcc -fpatchable-function-entry=5,0 -c a.c % objdump -d a.o ... : 0: 90 nop 1: 90