From a5892d4d0b7708505d8319834c4ff2f3e1218afc Mon Sep 17 00:00:00 2001 From: Florian Schmiderer Date: Fri, 10 May 2024 11:42:20 +0200 Subject: [PATCH] added comment --- compiler/rustc_codegen_llvm/src/back/write.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index 0771584189fc5..0511e5161e66c 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -220,6 +220,8 @@ pub fn target_machine_factory( let use_init_array = !sess.opts.unstable_opts.use_ctors_section.unwrap_or(sess.target.use_ctors_section); + // this annotes in the debug file that code is hotpatchable. In addtion without it -functionpadmin will be ignored. + // See: https://github.com/llvm/llvm-project/blob/d703b922961e0d02a5effdd4bfbb23ad50a3cc9f/lld/COFF/Writer.cpp#L1298 let use_hotpatch = sess.opts.unstable_opts.ms_hotpatch && sess.target.is_x86(); let path_mapping = sess.source_map().path_mapping().clone();