about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2020-10-26 20:55:07 +0100
committerAnthony Ramine <nox@nox.paris>2020-10-26 23:26:43 +0100
commit056942215cf8dc39686fa80e42b4e73657d4fed5 (patch)
tree30ea88aeefa520cf0156c14526a97d45f6128b08 /compiler/rustc_codegen_llvm/src
parent53fa22a6fb293d9fb82221695a643825953aa34c (diff)
downloadrust-056942215cf8dc39686fa80e42b4e73657d4fed5.tar.gz
rust-056942215cf8dc39686fa80e42b4e73657d4fed5.zip
Implement -Z function-sections=yes|no
This lets rustc users tweak whether all functions should be put in their own
TEXT section, using whatever default value the target defines if the flag
is missing.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/write.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
index ea1a7cfa5d3..3902df8a7ca 100644
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
@@ -128,7 +128,8 @@ pub fn target_machine_factory(
     let (opt_level, _) = to_llvm_opt_settings(optlvl);
     let use_softfp = sess.opts.cg.soft_float;
 
-    let ffunction_sections = sess.target.options.function_sections;
+    let ffunction_sections =
+        sess.opts.debugging_opts.function_sections.unwrap_or(sess.target.options.function_sections);
     let fdata_sections = ffunction_sections;
 
     let code_model = to_llvm_code_model(sess.code_model());