History

tccasm: support .weak labels

Joe Soroka committed 15 years ago

Commit c59d3421 parent 4d5105c2 files · +5 −0Browse files

Unified · Split

2 files
  1. tcc.h +1 −0
  2. tccasm.c +4 −0
tcc.h+1−0
@@ -715,6 +715,7 @@ struct TCCState { · 714 unmodified lines
715715
716716 #define DEF_ASM(x) DEF(TOK_ASM_ ## x, #x)
717717 #define TOK_ASM_int TOK_INT
718+#define TOK_ASM_weak TOK_WEAK1
718719
719720 #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
720721 /* only used for i386 asm opcodes definitions */
tccasm.c+4−0
@@ -481,6 +481,8 @@ static void asm_parse_directive(TCCState *s1) · 480 unmodified lines
481481 break;
482482 case TOK_ASM_globl:
483483 case TOK_ASM_global:
484+ case TOK_ASM_weak:
485+ tok1 = tok;
484486 do {
485487 Sym *sym;
486488
@@ -491,6 +493,8 @@ static void asm_parse_directive(TCCState *s1) · 4 unmodified lines
491493 sym->type.t = VT_VOID;
492494 }
493495 sym->type.t &= ~VT_STATIC;
496+ if (tok1 == TOK_ASM_weak)
497+ sym->type.t |= VT_WEAK;
494498 next();
495499 } while (tok == ',');
496500 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t