aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorJoe Soroka <gits@joesoroka.com>2011-03-02 13:31:09 -0800
committerJoe Soroka <gits@joesoroka.com>2011-03-02 13:31:09 -0800
commit823f83263012524b27033e908df86b592ee1a21b (patch)
tree87ff8f4926506032b8704d8c86912e76490b38ee /tccgen.c
parent684723488d09f129f0e945ba860dc477c0068305 (diff)
downloadtinycc-823f83263012524b27033e908df86b592ee1a21b.tar.gz
tinycc-823f83263012524b27033e908df86b592ee1a21b.tar.bz2
tcc: fix weak attribute handling
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tccgen.c b/tccgen.c
index b84e7b6..3ecfb09 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -2927,9 +2927,6 @@ static int parse_btype(CType *type, AttributeDef *ad)
case TOK_ATTRIBUTE1:
case TOK_ATTRIBUTE2:
parse_attribute(ad);
- if (ad->weak) {
- t |= VT_WEAK;
- }
if (ad->mode) {
u = ad->mode -1;
t = (t & ~VT_BTYPE) | u;
@@ -3189,9 +3186,6 @@ static void type_decl(CType *type, AttributeDef *ad, int *v, int td)
if (tok == TOK_ATTRIBUTE1 || tok == TOK_ATTRIBUTE2)
parse_attribute(ad);
- if (ad->weak)
- type->t |= VT_WEAK;
-
if (!type1.t)
return;
/* append type at the end of type1 */
@@ -5445,6 +5439,8 @@ ST_FUNC void decl(int l)
func_decl_list(sym);
}
+ if (ad.weak)
+ type.t |= VT_WEAK;
#ifdef TCC_TARGET_PE
if (ad.func_import)
type.t |= VT_IMPORT;