1
0
Fork 0

riscv: Support $ in identifiers in extended asm.

Needed for using `__global_pointer$`.
$ don't have special meaning in RISC-V assembly.
This commit is contained in:
Ekaitz Zarraga 2024-03-21 01:29:49 +01:00
parent e2d8eb3d1c
commit 3782da8d0c
1 changed files with 4 additions and 0 deletions

View File

@ -1014,7 +1014,9 @@ static void tcc_assemble_inline(TCCState *s1, char *str, int len, int global)
{
const int *saved_macro_ptr = macro_ptr;
int dotid = set_idnum('.', IS_ID);
#ifndef TCC_TARGET_RISCV64
int dolid = set_idnum('$', 0);
#endif
tcc_open_bf(s1, ":asm:", len);
memcpy(file->buffer, str, len);
@ -1022,7 +1024,9 @@ static void tcc_assemble_inline(TCCState *s1, char *str, int len, int global)
tcc_assemble_internal(s1, 0, global);
tcc_close();
#ifndef TCC_TARGET_RISCV64
set_idnum('$', dolid);
#endif
set_idnum('.', dotid);
macro_ptr = saved_macro_ptr;
}