| @@ -483,6 +483,7 @@ static void asm_parse_directive(TCCState *s1) · 482 unmodified lines |
| 483 | case TOK_ASM_globl: | 483 | case TOK_ASM_globl: |
| 484 | case TOK_ASM_global: | 484 | case TOK_ASM_global: |
| 485 | case TOK_ASM_weak: | 485 | case TOK_ASM_weak: |
| | 486 | case TOK_ASM_hidden: |
| 486 | tok1 = tok; | 487 | tok1 = tok; |
| 487 | do { | 488 | do { |
| 488 | Sym *sym; | 489 | Sym *sym; |
| @@ -493,9 +494,12 @@ static void asm_parse_directive(TCCState *s1) · 4 unmodified lines |
| 493 | sym = label_push(&s1->asm_labels, tok, 0); | 494 | sym = label_push(&s1->asm_labels, tok, 0); |
| 494 | sym->type.t = VT_VOID; | 495 | sym->type.t = VT_VOID; |
| 495 | } | 496 | } |
| 496 | sym->type.t &= ~VT_STATIC; | 497 | if (tok1 != TOK_ASM_hidden) |
| | 498 | sym->type.t &= ~VT_STATIC; |
| 497 | if (tok1 == TOK_ASM_weak) | 499 | if (tok1 == TOK_ASM_weak) |
| 498 | sym->type.t |= VT_WEAK; | 500 | sym->type.t |= VT_WEAK; |
| | 501 | else if (tok1 == TOK_ASM_hidden) |
| | 502 | sym->type.t |= STV_HIDDEN << VT_VIS_SHIFT; |
| 499 | next(); | 503 | next(); |
| 500 | } while (tok == ','); | 504 | } while (tok == ','); |
| 501 | break; | 505 | break; |
| @@ -588,12 +592,12 @@ static void asm_parse_directive(TCCState *s1) · 86 unmodified lines |
| 588 | tcc_error("label not found: %s", get_tok_str(tok, NULL)); | 592 | tcc_error("label not found: %s", get_tok_str(tok, NULL)); |
| 589 | } | 593 | } |
| 590 | | 594 | |
| 591 | next(); | | |
| 592 | skip(','); | | |
| 593 | /* XXX .size name,label2-label1 */ | 595 | /* XXX .size name,label2-label1 */ |
| 594 | if (s1->warn_unsupported) | 596 | if (s1->warn_unsupported) |
| 595 | tcc_warning("ignoring .size %s,*", get_tok_str(tok, NULL)); | 597 | tcc_warning("ignoring .size %s,*", get_tok_str(tok, NULL)); |
| 596 | | 598 | |
| | 599 | next(); |
| | 600 | skip(','); |
| 597 | while (tok != '\n' && tok != CH_EOF) { | 601 | while (tok != '\n' && tok != CH_EOF) { |
| 598 | next(); | 602 | next(); |
| 599 | } | 603 | } |
| @@ -622,7 +626,7 @@ static void asm_parse_directive(TCCState *s1) · 22 unmodified lines |
| 622 | } | 626 | } |
| 623 | | 627 | |
| 624 | if (!strcmp(newtype, "function") || !strcmp(newtype, "STT_FUNC")) { | 628 | if (!strcmp(newtype, "function") || !strcmp(newtype, "STT_FUNC")) { |
| 625 | sym->type.t = VT_FUNC; | 629 | sym->type.t = (sym->type.t & ~VT_BTYPE) | VT_FUNC; |
| 626 | } | 630 | } |
| 627 | else if (s1->warn_unsupported) | 631 | else if (s1->warn_unsupported) |
| 628 | tcc_warning("change type of '%s' from 0x%x to '%s' ignored", | 632 | tcc_warning("change type of '%s' from 0x%x to '%s' ignored", |