From a32b5929ccf8cbf79396d8924097a1a911985dac Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 26 Mar 2017 21:07:07 -0400 Subject: add stack protector safety when linking libc * introduce zigrt file. it contains only weak symbols so that multiple instances can be merged. it contains __zig_panic so that multiple .o files can call the same panic function. * remove `@setFnVisible` builtin and add @setGlobalLinkage builtin which is more powerful * add `@panic` builtin function. * fix collision of symbols with extern prototypes and internal function names * add stack protector safety when linking against libc. To add the safety mechanism without libc requires implementing Thread Local Storage. See #276 --- src/parseh.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/parseh.cpp') diff --git a/src/parseh.cpp b/src/parseh.cpp index b4582e26b4..77cc15cc0f 100644 --- a/src/parseh.cpp +++ b/src/parseh.cpp @@ -635,8 +635,7 @@ static void visit_fn_decl(Context *c, const FunctionDecl *fn_decl) { } assert(fn_type->id == TypeTableEntryIdFn); - bool internal_linkage = false; - FnTableEntry *fn_entry = create_fn_raw(FnInlineAuto, internal_linkage); + FnTableEntry *fn_entry = create_fn_raw(FnInlineAuto, GlobalLinkageIdStrong); buf_init_from_buf(&fn_entry->symbol_name, fn_name); fn_entry->type_entry = fn_type; -- cgit v1.2.3