1
Fork 0

Unconditionally update symbols

All paths to an ArchiveBuilder::build call update_symbols first.
This commit is contained in:
bjorn3 2022-02-10 18:27:18 +01:00
parent 203b622a65
commit 609784711a
5 changed files with 1 additions and 22 deletions

View file

@ -51,7 +51,6 @@ pub trait ArchiveBuilder<'a> {
fn add_archive<F>(&mut self, archive: &Path, skip: F) -> io::Result<()>
where
F: FnMut(&str) -> bool + 'static;
fn update_symbols(&mut self);
fn build(self);

View file

@ -371,10 +371,6 @@ 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);
}
@ -503,7 +499,6 @@ fn link_staticlib<'a, B: ArchiveBuilder<'a>>(
sess.fatal(&e);
}
ab.update_symbols();
ab.build();
if !all_native_libs.is_empty() {
@ -2304,7 +2299,6 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
sess.prof.generic_activity_with_arg("link_altering_rlib", name).run(|| {
let mut archive = <B as ArchiveBuilder>::new(sess, &dst, Some(cratepath));
archive.update_symbols();
let mut any_objects = false;
for f in archive.src_files() {