The following example tries to create an elf section with three integers using inline assembly. asm (".pushsection .test\n" ".long 0, %0, %1\n" ".popsection" :: "i"(ENUM_VAL2), "i"(2)); But it fails because gcc emits the assembly code with $. Is there a way to instruct gcc to avoid emitting $? .pushsection .test .long 0, $1, $2 <<<<<< .popsection
asm (".pushsection .test\n" ".long 0, %P0, %P1\n" ".popsection" :: "i"(ENUM_VAL2), "i"(2)); but this is quite hackish, %P isn't meant for this. On newer GCC versions there is %p, which is better. Can't you just do this with attribute((section(".test")))? Segher