give an error message when the surgical linker would fail with know issue #3609

This commit is contained in:
Brendan Hansknecht 2022-10-09 11:39:10 -07:00
parent 7125ccb7b5
commit b306c9a76b
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -985,6 +985,16 @@ pub(crate) fn surgery_elf(
}
};
if app_obj
.sections()
.flat_map(|sec| sec.relocations())
.any(|(_, reloc)| reloc.kind() == RelocationKind::Absolute)
{
eprintln!("The surgical linker currently has issue #3609 and would fail linking your app.");
eprintln!("Please use `--linker=legacy` to avoid the issue for now.");
std::process::exit(1);
}
let total_start = Instant::now();
let loading_metadata_start = total_start;