aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2023-10-04 15:16:52 +0200
committerAndrew Kelley <andrew@ziglang.org>2023-10-04 11:21:56 -0700
commit8b4e3b6aee61a26e7229ea30728e6c5e31c7cd0b (patch)
treec78414c59ad23d9dd24b8989cced5589203370a2 /src/zig_llvm.cpp
parenta306bfcd8eec166906ce2839bc7ff86ba6335376 (diff)
downloadzig-8b4e3b6aee61a26e7229ea30728e6c5e31c7cd0b.tar.gz
zig-8b4e3b6aee61a26e7229ea30728e6c5e31c7cd0b.zip
comp: add support for -fdata-sections
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index 5a776aea51..0af82b841e 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -82,7 +82,8 @@ static const bool assertions_on = false;
LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Triple,
const char *CPU, const char *Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc,
- LLVMCodeModel CodeModel, bool function_sections, ZigLLVMABIType float_abi, const char *abi_name)
+ LLVMCodeModel CodeModel, bool function_sections, bool data_sections, ZigLLVMABIType float_abi,
+ const char *abi_name)
{
std::optional<Reloc::Model> RM;
switch (Reloc){
@@ -130,6 +131,7 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri
TargetOptions opt;
opt.FunctionSections = function_sections;
+ opt.DataSections = data_sections;
switch (float_abi) {
case ZigLLVMABITypeDefault:
opt.FloatABIType = FloatABI::Default;