I have a bound check statement that is optimized by clang and as a result verifier doesn't accept the program. I would like to write it using embedded assembly. I am not sure how to do it. I know that the __asm__ block given bellow will compile to if r3 > r1 goto pc+5 . What I don't know is how to reference labels in the embedded assembly.
Writing eBPF assembly is very different than x86 (actually feels more intuitive). I wonder if there is a manual or a document or source file in Clang that can help me understand the syntax.
__asm__("if %0 > %1 goto 5 \n\t"
:
: "r"(tmp_ptr), "r"(data_end)
:
);