mirror of
https://github.com/frida/tinycc
synced 2024-11-27 18:19:35 +03:00
tccasm: support .weak labels
This commit is contained in:
parent
4d5105c8f1
commit
c59d3426b8
1
tcc.h
1
tcc.h
@ -715,6 +715,7 @@ struct TCCState {
|
||||
|
||||
#define DEF_ASM(x) DEF(TOK_ASM_ ## x, #x)
|
||||
#define TOK_ASM_int TOK_INT
|
||||
#define TOK_ASM_weak TOK_WEAK1
|
||||
|
||||
#if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
|
||||
/* only used for i386 asm opcodes definitions */
|
||||
|
4
tccasm.c
4
tccasm.c
@ -481,6 +481,8 @@ static void asm_parse_directive(TCCState *s1)
|
||||
break;
|
||||
case TOK_ASM_globl:
|
||||
case TOK_ASM_global:
|
||||
case TOK_ASM_weak:
|
||||
tok1 = tok;
|
||||
do {
|
||||
Sym *sym;
|
||||
|
||||
@ -491,6 +493,8 @@ static void asm_parse_directive(TCCState *s1)
|
||||
sym->type.t = VT_VOID;
|
||||
}
|
||||
sym->type.t &= ~VT_STATIC;
|
||||
if (tok1 == TOK_ASM_weak)
|
||||
sym->type.t |= VT_WEAK;
|
||||
next();
|
||||
} while (tok == ',');
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user