about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-11-02 00:12:32 +0000
committerbors <bors@rust-lang.org>2020-11-02 00:12:32 +0000
commit3d0682b97a3a03bcf54337b56002fb6b2b0ce244 (patch)
tree3eb3f13b1841a6fa4f16cb4bd42b29e4f678545f /compiler/rustc_codegen_llvm/src
parentb2025326088b54fb3f083bebeba14e0a15bf00d3 (diff)
parent6febaf2419a528b08d03349de205237fd8bba4b9 (diff)
downloadrust-3d0682b97a3a03bcf54337b56002fb6b2b0ce244.tar.gz
rust-3d0682b97a3a03bcf54337b56002fb6b2b0ce244.zip
Auto merge of #78605 - nox:relax-elf-relocations, r=nagisa
Implement -Z relax-elf-relocations=yes|no

This lets rustc users tweak whether the linker should relax ELF relocations without recompiling a whole new target with its own libcore etc.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/write.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
index 3902df8a7ca..f13c2d312df 100644
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
@@ -156,7 +156,11 @@ pub fn target_machine_factory(
     let emit_stack_size_section = sess.opts.debugging_opts.emit_stack_sizes;
 
     let asm_comments = sess.asm_comments();
-    let relax_elf_relocations = sess.target.options.relax_elf_relocations;
+    let relax_elf_relocations = sess
+        .opts
+        .debugging_opts
+        .relax_elf_relocations
+        .unwrap_or(sess.target.options.relax_elf_relocations);
 
     let use_init_array = !sess
         .opts