| @@ -2472,6 +2472,16 @@ static void parse_attribute(AttributeDef *ad) · 2471 unmodified lines |
| 2472 | next(); | 2472 | next(); |
| 2473 | skip(')'); | 2473 | skip(')'); |
| 2474 | break; | 2474 | break; |
| | 2475 | case TOK_ALIAS1: |
| | 2476 | case TOK_ALIAS2: |
| | 2477 | skip('('); |
| | 2478 | if (tok != TOK_STR) |
| | 2479 | expect("alias(\"target\")"); |
| | 2480 | ad->alias_target = /* save string as token, for later */ |
| | 2481 | tok_alloc((char*)tokc.cstr->data, tokc.cstr->size-1)->tok; |
| | 2482 | next(); |
| | 2483 | skip(')'); |
| | 2484 | break; |
| 2475 | case TOK_ALIGNED1: | 2485 | case TOK_ALIGNED1: |
| 2476 | case TOK_ALIGNED2: | 2486 | case TOK_ALIGNED2: |
| 2477 | if (tok == '(') { | 2487 | if (tok == '(') { |
| @@ -5578,7 +5588,20 @@ ST_FUNC void decl(int l) · 3100 unmodified lines |
| 5578 | /* NOTE: as GCC, uninitialized global static | 5588 | /* NOTE: as GCC, uninitialized global static |
| 5579 | arrays of null size are considered as | 5589 | arrays of null size are considered as |
| 5580 | extern */ | 5590 | extern */ |
| 5581 | external_sym(v, &type, r, asm_label); | 5591 | sym = external_sym(v, &type, r, asm_label); |
| | 5592 | |
| | 5593 | if (ad.alias_target) { |
| | 5594 | Section tsec; |
| | 5595 | Elf32_Sym *esym; |
| | 5596 | Sym *alias_target; |
| | 5597 | |
| | 5598 | alias_target = sym_find(ad.alias_target); |
| | 5599 | if (!alias_target || !alias_target->c) |
| | 5600 | error("unsupported forward __alias__ attribute"); |
| | 5601 | esym = &((Elf32_Sym *)symtab_section->data)[alias_target->c]; |
| | 5602 | tsec.sh_num = esym->st_shndx; |
| | 5603 | put_extern_sym2(sym, &tsec, esym->st_value, esym->st_size, 0); |
| | 5604 | } |
| 5582 | } else { | 5605 | } else { |
| 5583 | type.t |= (btype.t & VT_STATIC); /* Retain "static". */ | 5606 | type.t |= (btype.t & VT_STATIC); /* Retain "static". */ |
| 5584 | if (type.t & VT_STATIC) | 5607 | if (type.t & VT_STATIC) |