Injecting user defined opcode

Segher Boessenkool segher@kernel.crashing.org
Sun Jun 30 06:15:00 GMT 2019


On Sun, Jun 30, 2019 at 05:42:28AM +0000, Mahmood Naderan wrote:
> #APP
> # 3 "test.c" 1
>         .byte 0x00
> # 0 "" 2
> #NO_APP
>         pop     rbp

> It seems that in the machine code generation, gcc combines 00 with the next instruction.

It doesn't.  It outputs your asm (".byte 0x00"), exactly as you told it.
The assembler processes that to some object file, again exactly as you
told it, which means it puts this 0 byte right in the middle of the
instructions.

Again: what did you *intend* to happen?


Segher



More information about the Gcc-help mailing list