From c0b7f20893ea5ca42e0d02b59db6f459c2f80ca1 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 17 Aug 2022 18:42:39 -0700 Subject: stage2: implement stack protectors This is one of the final remaining TODOs for the LLVM backend. --- src/link/Elf.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/link/Elf.zig') diff --git a/src/link/Elf.zig b/src/link/Elf.zig index 2f67c35205..9902886bac 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -1673,6 +1673,12 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v } } + // stack-protector. + // Related: https://github.com/ziglang/zig/issues/7265 + if (comp.libssp_static_lib) |ssp| { + try argv.append(ssp.full_object_path); + } + // compiler-rt if (compiler_rt_path) |p| { try argv.append(p); -- cgit v1.2.3