Skip to content

Commit

Permalink
write/coff: use duplicate names for refptr stub sections (#475)
Browse files Browse the repository at this point in the history
MSVC's linker is slow if there are many different section names,
and we don't care about the ordering of these sections.
  • Loading branch information
afonso360 authored Oct 13, 2022
1 parent cdb1300 commit ef9c666
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/write/coff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ impl<'a> Object<'a> {
}
let stub_size = self.architecture.address_size().unwrap().bytes();

let mut name = b".rdata$.refptr.".to_vec();
name.extend_from_slice(&self.symbols[symbol_id.0].name);
let name = b".rdata$.refptr".to_vec();
let section_id = self.add_section(Vec::new(), name, SectionKind::ReadOnlyData);
let section = self.section_mut(section_id);
section.set_data(vec![0; stub_size as usize], u64::from(stub_size));
Expand Down

0 comments on commit ef9c666

Please sign in to comment.