diff options
| author | jiang <30155751@qq.com> | 2014-04-29 16:05:16 +0800 |
|---|---|---|
| committer | jiang <30155751@qq.com> | 2014-04-29 16:05:16 +0800 |
| commit | 2a8905c93b4f67a21e3dbf297c3e93c598831528 (patch) | |
| tree | 6f7491150cfe01700c9863946906203adad0de13 /tccasm.c | |
| parent | 02e2fe3c260415f4cb1cbcaca9b2403a17f7ff2e (diff) | |
| parent | e20c1eb99e1003c1e59522c136dbb15c52d7cc7c (diff) | |
| download | tinycc-2a8905c93b4f67a21e3dbf297c3e93c598831528.tar.gz tinycc-2a8905c93b4f67a21e3dbf297c3e93c598831528.tar.bz2 | |
So that the generated code, and more short
Diffstat (limited to 'tccasm.c')
| -rw-r--r-- | tccasm.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -232,7 +232,7 @@ static inline void asm_expr_sum(TCCState *s1, ExprValue *pe) } else { goto cannot_relocate; } - pe->sym = NULL; /* same symbols can be substracted to NULL */ + pe->sym = NULL; /* same symbols can be subtracted to NULL */ } else { cannot_relocate: tcc_error("invalid operation with label"); @@ -483,6 +483,7 @@ static void asm_parse_directive(TCCState *s1) case TOK_ASM_globl: case TOK_ASM_global: case TOK_ASM_weak: + case TOK_ASM_hidden: tok1 = tok; do { Sym *sym; @@ -493,9 +494,12 @@ static void asm_parse_directive(TCCState *s1) sym = label_push(&s1->asm_labels, tok, 0); sym->type.t = VT_VOID; } - sym->type.t &= ~VT_STATIC; + if (tok1 != TOK_ASM_hidden) + sym->type.t &= ~VT_STATIC; if (tok1 == TOK_ASM_weak) sym->type.t |= VT_WEAK; + else if (tok1 == TOK_ASM_hidden) + sym->type.t |= STV_HIDDEN << VT_VIS_SHIFT; next(); } while (tok == ','); break; @@ -588,12 +592,12 @@ static void asm_parse_directive(TCCState *s1) tcc_error("label not found: %s", get_tok_str(tok, NULL)); } - next(); - skip(','); /* XXX .size name,label2-label1 */ if (s1->warn_unsupported) tcc_warning("ignoring .size %s,*", get_tok_str(tok, NULL)); + next(); + skip(','); while (tok != '\n' && tok != CH_EOF) { next(); } @@ -622,7 +626,7 @@ static void asm_parse_directive(TCCState *s1) } if (!strcmp(newtype, "function") || !strcmp(newtype, "STT_FUNC")) { - sym->type.t = VT_FUNC; + sym->type.t = (sym->type.t & ~VT_BTYPE) | VT_FUNC; } else if (s1->warn_unsupported) tcc_warning("change type of '%s' from 0x%x to '%s' ignored", |
