Place unwind info directly after the text section, even when debug info is enabled
When debug info was enabled, we would put the debug info sections in between the text section and the unwind info section. But the unwind info is encoded in a position-independent manner (so that we don't need relocs for it) that relies on it directly following the text section. The result of the misplacement was some crashes inside the unwinder.
This commit is contained in:
@@ -25,6 +25,12 @@ impl UnwindRegistration {
|
||||
unwind_info: *mut u8,
|
||||
unwind_len: usize,
|
||||
) -> Result<UnwindRegistration> {
|
||||
debug_assert_eq!(
|
||||
unwind_info as usize % region::page::size(),
|
||||
0,
|
||||
"The unwind info must always be aligned to a page"
|
||||
);
|
||||
|
||||
let mut registrations = Vec::new();
|
||||
if cfg!(any(
|
||||
all(target_os = "linux", target_env = "gnu"),
|
||||
|
||||
Reference in New Issue
Block a user