From 203b622a6590d6469e37ce827a62d5931cc837f2 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Thu, 10 Feb 2022 18:18:38 +0100 Subject: [PATCH] Remove unnecessary update_symbols call For cg_llvm update_symbols merely sets a flag, so changing the position or removing an additional call doesn't have any effect. --- compiler/rustc_codegen_ssa/src/back/link.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 7a13e424f9a..3ac98e392ae 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -333,10 +333,6 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>( ab.inject_dll_import_lib(&raw_dylib_name, &raw_dylib_imports, tmpdir); } - // After adding all files to the archive, we need to update the - // symbol table of the archive. - ab.update_symbols(); - // Note that it is important that we add all of our non-object "magical // files" *after* all of the object files in the archive. The reason for // this is as follows: @@ -365,13 +361,6 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>( // normal linkers for the platform. let metadata = create_rmeta_file(sess, codegen_results.metadata.raw_data()); ab.add_file(&emit_metadata(sess, &metadata, tmpdir)); - - // After adding all files to the archive, we need to update the - // symbol table of the archive. This currently dies on macOS (see - // #11162), and isn't necessary there anyway - if !sess.target.is_like_osx { - ab.update_symbols(); - } } RlibFlavor::StaticlibBase => { @@ -381,6 +370,11 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>( } } } + + // After adding all files to the archive, we need to update the + // symbol table of the archive. + ab.update_symbols(); + return Ok(ab); }