-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OS-specific implementations; Use three 0x90 instead of 3-byte NOP…
…s in case the jmp is not 2 bytes long
- Loading branch information
1 parent
8e926a0
commit 1c39270
Showing
5 changed files
with
118 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//! Linux-specific implementations | ||
use crate::JumpEntry; | ||
|
||
/// Section name of | ||
#[doc(hidden)] | ||
#[macro_export] | ||
macro_rules! os_static_key_sec_name { | ||
() => { | ||
"__static_keys" | ||
}; | ||
} | ||
|
||
// See https://sourceware.org/binutils/docs/ld/Input-Section-Example.html, modern linkers | ||
// will generate these two symbols indicating the start and end address of __static_keys | ||
// section. Note that the end address is excluded. | ||
extern "Rust" { | ||
/// Address of this static is the start address of __static_keys section | ||
#[link_name = "__start___static_keys"] | ||
pub static mut JUMP_ENTRY_START: JumpEntry; | ||
/// Address of this static is the end address of __static_keys section (excluded) | ||
#[link_name = "__stop___static_keys"] | ||
pub static mut JUMP_ENTRY_STOP: JumpEntry; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//! OS-specific implementations | ||
#[cfg(target_os = "linux")] | ||
mod linux; | ||
#[cfg(target_os = "linux")] | ||
pub use linux::*; |