Unified · Split
| @@ -601,8 +601,7 @@ static void asm_parse_directive(TCCState *s1) · 600 unmodified lines | ||
| 601 | 601 | case TOK_ASM_type: |
| 602 | 602 | { |
| 603 | 603 | Sym *sym; |
| 604 | − char newtype[64]; | |
| 605 | − newtype[0] = 0; | |
| 604 | + const char *newtype; | |
| 606 | 605 | |
| 607 | 606 | next(); |
| 608 | 607 | sym = label_find(tok); |
| @@ -613,13 +612,15 @@ static void asm_parse_directive(TCCState *s1) · 4 unmodified lines | ||
| 613 | 612 | |
| 614 | 613 | next(); |
| 615 | 614 | skip(','); |
| 616 | − skip('@'); | |
| 617 | − if (tok == TOK_STR) | |
| 618 | − pstrcat(newtype, sizeof(newtype), tokc.cstr->data); | |
| 619 | − else | |
| 620 | − pstrcat(newtype, sizeof(newtype), get_tok_str(tok, NULL)); | |
| 615 | + if (tok == TOK_STR) { | |
| 616 | + newtype = tokc.cstr->data; | |
| 617 | + } else { | |
| 618 | + if (tok == '@' || tok == '%') | |
| 619 | + skip(tok); | |
| 620 | + newtype = get_tok_str(tok, NULL); | |
| 621 | + } | |
| 621 | 622 | |
| 622 | − if (!strcmp(newtype, "function")) { | |
| 623 | + if (!strcmp(newtype, "function") || !strcmp(newtype, "STT_FUNC")) { | |
| 623 | 624 | sym->type.t = VT_FUNC; |
| 624 | 625 | } |
| 625 | 626 | else if (s1->warn_unsupported) |
| @@ -592,3 +592,17 @@ int $0x10 · 591 unmodified lines | ||
| 592 | 592 | #ifdef __ASSEMBLER__ // should be defined, for S files |
| 593 | 593 | inc %eax |
| 594 | 594 | #endif |
| 595 | + | |
| 596 | +ft1: ft2: ft3: ft4: ft5: ft6: ft7: ft8: ft9: | |
| 597 | + xor %eax, %eax | |
| 598 | + ret | |
| 599 | + | |
| 600 | +.type ft1,STT_FUNC | |
| 601 | +.type ft2,@STT_FUNC | |
| 602 | +.type ft3,%STT_FUNC | |
| 603 | +.type ft4,"STT_FUNC" | |
| 604 | +.type ft5,function | |
| 605 | +.type ft6,@function | |
| 606 | +.type ft7,%function | |
| 607 | +.type ft8,"function" | |
| 608 | + | |