In gcc inline assembly for x86, How can I move the address of a label in a register. What it should be instead of $label here, because the assembler is giving error undefined reference to label.
Note that the label is outside the asm block, that is, within the normal C code.
__asm__ __volatile__ ("movl $label, %eax;"); label: .....
You can do:
register unsigned long eax __asm__("eax"); // See  eax = &&label; // See  label: // some code
However, beware: GCC is free to reorder code under optimization, and so the C
label may not be exactly where you would it expect it to be.
If you need precise placement of
label (e.g. because some assembly code will jump to it), you'll be better off coding the whole thing in assembly.