From 00c43cda7202a15a95096961b9301ca3181c3c0a Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 10 Feb 2010 22:09:13 +0000 Subject: [PATCH] put zero initialized entities into bss section (not just uninitialized ones); TLS entities should go to tbss or tdata [r27108] --- ast2firm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ast2firm.c b/ast2firm.c index af9f193..b3079cb 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -4562,8 +4562,12 @@ static void create_global_variable(entity_t *entity) panic("invalid storage class for global var"); } - ir_type *var_type = entity->variable.thread_local ? - get_tls_type() : get_glob_type(); + ir_type *var_type = get_glob_type(); + if (entity->variable.thread_local) { + var_type = get_tls_type(); + /* LINKAGE_MERGE not supported by current linkers */ + linkage &= ~IR_LINKAGE_MERGE; + } create_variable_entity(entity, DECLARATION_KIND_GLOBAL_VARIABLE, var_type); irentity = entity->variable.v.entity; add_entity_linkage(irentity, linkage); -- 2.20.1