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.
This commit is contained in:
bjorn3 2022-02-10 18:18:38 +01:00
parent 502d6aa47b
commit 203b622a65

View file

@ -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);
}