diff options
| author | bors <bors@rust-lang.org> | 2020-10-28 17:47:36 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-28 17:47:36 +0000 |
| commit | 3dddf6ac1e194deb3d927064e7c6d50bc9325dd0 (patch) | |
| tree | c556b1e3d4e07137fba7ae09ddcd19e4e25be060 /compiler/rustc_codegen_llvm/src | |
| parent | 717eb6ccea0f9e0079eab82c047bbc1ebde725c2 (diff) | |
| parent | 056942215cf8dc39686fa80e42b4e73657d4fed5 (diff) | |
| download | rust-3dddf6ac1e194deb3d927064e7c6d50bc9325dd0.tar.gz rust-3dddf6ac1e194deb3d927064e7c6d50bc9325dd0.zip | |
Auto merge of #78414 - nox:function-sections, r=nagisa,bjorn3
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. I'm having fun experimenting with musl libc and trying to implement the start symbol in Rust, that means avoiding code that requires relocations, and AFAIK putting everything in its own section makes the toolchain generate `GOTPCREL` relocations for symbols that could use plain old PC-relative addressing (at least on `x86_64`) if they were all in the same section.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/write.rs | 3 |
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()); |
