The following code compiled with avr-gcc 4.5 results in an assembler file that gas is not able translate correctly. void function() {} int main(void) { asm volatile ( "rjmp %[Function]\n" : : [Function] "i" (function) ); } The rjmp could be also a jmp, call or something similar. The compiler translates this to rjmp gs(_Z8functionv) which is in my eyes correct. However, this line is rejected by gas with the message /tmp/cc6RG14B.s: Assembler messages: /tmp/cc6RG14B.s:39: Error: garbage at end of line Maybe it is a bug in the parser component of gas and the bug may be related to Bug #11102.
(In reply to comment #0) > The following code compiled with avr-gcc 4.5 results in an assembler file that > gas is not able translate correctly. > > void function() {} > > int main(void) { > asm volatile ( > "rjmp %[Function]\n" > : > : [Function] "i" (function) > ); > } > > The rjmp could be also a jmp, call or something similar. The compiler > translates this to > > rjmp gs(_Z8functionv) A gs() makes no sense here. Write "rjmp %x[Function]"
(In reply to comment #1) > A gs() makes no sense here. Write "rjmp %x[Function]" Yes, you are right. The %x does what I had in mind. Where is this %x modifier documented. I could not find it. Are there other/further modifiers with special meanings?
The modifiers are described at top of GCC's AVR machine description file located at ./gcc/config/avr/avr.md http://gcc.gnu.org/viewcvs/trunk/gcc/config/avr/avr.md?content-type=text%2Fplain&view=co The function to print assembler code template is ./gcc/config/avr/avr.c:avr_print_operand() ./gcc/final.c:output_asm_insn() The first is avr-specific output like %A and the second is machine independent like %n.
Aha, thank you. Apropos, that is the reason why I had not find it, because I looked only in the documentation of the avr part. Maybe such information should be even integrated in the documentation or at least giving a note as a pointer to that file.