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).
This is the same as .set, but neither seem available for ARM assembly. Not sure about other architectures, but I think this should be supported as is. This is remarkably similar to what exception handling tables do: .Lset0 = .Leh_func_begin0-.Leh_func_begin0 # >> Call Site 1 << So, it's possible that support is already there, but disconnected from this specific case, since this also fails: .syntax unified size = end - start add r0, r0, #size start: .space 0x10 end: 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: .syntax unified add r0, r0, #SYM SYM: .byte 0x4