You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some assembly code that uses .equ to set a symbol to a computed constant. It works in GCC but not LLVM. I am not sure about the correct terminology, but here is an example:
I'm not sure this is due to the lack of .set/.equ/= directives (which would have produced an error earlier), I believe this is just an issue with literals using computed constants, since this also fails:
Extended Description
I have some assembly code that uses .equ to set a symbol to a computed constant. It works in GCC but not LLVM. I am not sure about the correct terminology, but here is an example:
.syntax unified
.equ size, end - start
add r0, r0, #size
start:
.space 0x10
end:
GCC will compile this to
add r0, r0, #​16
. Compiling with llvm-mc gives:set.s:4:13: error: invalid operand for instruction
add r0, r0, #size
^
It works for llvm-mc if the #size is set to a constant (e.g. .set size, 0x10).
The text was updated successfully, but these errors were encountered: