mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Fix MSVC hang issue
This commit is contained in:
parent
8693227e5e
commit
9ebeb284b5
@ -1691,6 +1691,12 @@ fn add_linked_symbol_object(
|
||||
return;
|
||||
};
|
||||
|
||||
// NOTE(nbdd0121): MSVC will hang if the input object file contains no sections,
|
||||
// so add an empty section.
|
||||
if file.format() == object::BinaryFormat::Coff {
|
||||
file.add_section(Vec::new(), ".text".into(), object::SectionKind::Text);
|
||||
}
|
||||
|
||||
for (sym, kind) in symbols.iter() {
|
||||
file.add_symbol(object::write::Symbol {
|
||||
name: sym.clone().into(),
|
||||
|
Loading…
Reference in New Issue
Block a user