Symbol refs in inline asm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

(GCC 4.2.2)
I would like to emit addresses relative to symbols using inline asm.
The following code:
asm volatile("... %0":: "i" (&symbol));
works well. However:
asm volatile("... %0":: "i" (&symbol+1));

fails with these errors:
test.c:24: warning: asm operand 0 probably doesn't match constraints
test.c:24: error: impossible constraint in 'asm'

According to the documentations, the "i" constraint:
"An immediate integer operand (one with constant value) is allowed. This
includes symbolic constants whose values will be known only at assembly time
or later."
Doesn't it include an offset from a symbolic constant?
I'd like to avoid constraints such as "g" because I need to guarantee a
constant is emitted, never a register.
Is there some way to do that?

Thanks,
Amir

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux