public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* -fpatchable-function-entry: leverage multi-byte NOP on x86
@ 2020-01-04 20:48 Fangrui Song
  2020-01-06  8:15 ` Fangrui Song
  2020-01-06  9:34 ` Martin Liška
  0 siblings, 2 replies; 4+ messages in thread
From: Fangrui Song @ 2020-01-04 20:48 UTC (permalink / raw)
  To: gcc; +Cc: Jan Hubicka

-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
...
0000000000000000 <foo>:
    0:   90                      nop
    1:   90                      nop
    2:   90                      nop
    3:   90                      nop
    4:   90                      nop
    5:   55                      push   %rbp
    6:   48 89 e5                mov    %rsp,%rbp
    9:   b8 00 00 00 00          mov    $0x0,%eax
    e:   5d                      pop    %rbp
    f:   c3                      retq


(I am not sure who should be notified. I CCed x86-64-port maintainer
(Jan Hubicka <hubicka@ucw.cz>), as listed on gcc/MAINTAINERS.)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-06  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-04 20:48 -fpatchable-function-entry: leverage multi-byte NOP on x86 Fangrui Song
2020-01-06  8:15 ` Fangrui Song
2020-01-06  9:34 ` Martin Liška
2020-01-06  9:40   ` Alexander Monakov

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).