Sujet : gcc arm inline asm: how to output value for .set directive? De : invalid (at) *nospam* invalid.invalid (Grant Edwards) Groupes :comp.arch.embedded Date : 03. Apr 2025, 23:04:38 Autres entêtes Organisation : PANIX Public Access Internet and UNIX, NYC Message-ID :<vsn0lm$2k4$1@reader1.panix.com> User-Agent : slrn/1.0.3 (Linux)
How do I convince ARM GCC's extended asm() to emit a value that can be used in a .set directive? Here's a simplified example:
The first of the two .set directive works. The second one doesn't. The offsetof() value is being used as desired, but gcc is prefixing the value with a '#' (presumably it thinks it's an instruction operand and not a directive operand). Here's an excerpt from the assembly listing:
And of course the assembler chucks a wobbly at line 35:
/tmp/cc1TaWVh.s: Assembler messages: /tmp/cc1TaWVh.s:35: Error: bad expression /tmp/cc1TaWVh.s:35: Error: junk at end of line, first unrecognized character is `4'
I've tried a bunch of gcc extended assembly input value constraints and modifiers, but can't find the magic code that emits the value "40" without the '#' on the front.
Any ideas?
Date
Sujet
#
Auteur
3 Apr 25
gcc arm inline asm: how to output value for .set directive?