diff options
| author | Anthony Ramine <nox@nox.paris> | 2020-10-26 20:55:07 +0100 |
|---|---|---|
| committer | Anthony Ramine <nox@nox.paris> | 2020-10-31 17:16:56 +0100 |
| commit | 6febaf2419a528b08d03349de205237fd8bba4b9 (patch) | |
| tree | c35aeb574d6a9046ad9607a57b435c1cdd209152 /compiler/rustc_codegen_llvm/src | |
| parent | 3478d7c3607ffbba629af2265c01002771e48c18 (diff) | |
| download | rust-6febaf2419a528b08d03349de205237fd8bba4b9.tar.gz rust-6febaf2419a528b08d03349de205237fd8bba4b9.zip | |
Implement -Z relax-elf-relocations=yes|no
This lets rustc users tweak whether the linker should relax ELF relocations, namely whether it should emit R_X86_64_GOTPCRELX relocations instead of R_X86_64_GOTPCREL, as the former is allowed by the ABI to be further optimised. The default value is whatever the target defines.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/write.rs | 6 |
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 |
