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:
parent
e2d8eb3d1c
commit
3782da8d0c
1 changed files with 4 additions and 0 deletions
4
tccasm.c
4
tccasm.c
|
@ -1014,7 +1014,9 @@ static void tcc_assemble_inline(TCCState *s1, char *str, int len, int global)
|
||||||
{
|
{
|
||||||
const int *saved_macro_ptr = macro_ptr;
|
const int *saved_macro_ptr = macro_ptr;
|
||||||
int dotid = set_idnum('.', IS_ID);
|
int dotid = set_idnum('.', IS_ID);
|
||||||
|
#ifndef TCC_TARGET_RISCV64
|
||||||
int dolid = set_idnum('$', 0);
|
int dolid = set_idnum('$', 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
tcc_open_bf(s1, ":asm:", len);
|
tcc_open_bf(s1, ":asm:", len);
|
||||||
memcpy(file->buffer, str, 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_assemble_internal(s1, 0, global);
|
||||||
tcc_close();
|
tcc_close();
|
||||||
|
|
||||||
|
#ifndef TCC_TARGET_RISCV64
|
||||||
set_idnum('$', dolid);
|
set_idnum('$', dolid);
|
||||||
|
#endif
|
||||||
set_idnum('.', dotid);
|
set_idnum('.', dotid);
|
||||||
macro_ptr = saved_macro_ptr;
|
macro_ptr = saved_macro_ptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue