Initial forward-edge CFI implementation (#3693)
* Initial forward-edge CFI implementation Give the user the option to start all basic blocks that are targets of indirect branches with the BTI instruction introduced by the Branch Target Identification extension to the Arm instruction set architecture. Copyright (c) 2022, Arm Limited. * Refactor `from_artifacts` to avoid second `make_executable` (#1) This involves "parsing" twice but this is parsing just the header of an ELF file so it's not a very intensive operation and should be ok to do twice. * Address the code review feedback Copyright (c) 2022, Arm Limited. Co-authored-by: Alex Crichton <alex@alexcrichton.com>
This commit is contained in:
@@ -168,6 +168,16 @@ pub trait MachInst: Clone + Debug {
|
||||
/// Is this a safepoint?
|
||||
fn is_safepoint(&self) -> bool;
|
||||
|
||||
/// Generate an instruction that must appear at the beginning of a basic
|
||||
/// block, if any. Note that the return value must not be subject to
|
||||
/// register allocation.
|
||||
fn gen_block_start(
|
||||
_is_indirect_branch_target: bool,
|
||||
_is_forward_edge_cfi_enabled: bool,
|
||||
) -> Option<Self> {
|
||||
None
|
||||
}
|
||||
|
||||
/// A label-use kind: a type that describes the types of label references that
|
||||
/// can occur in an instruction.
|
||||
type LabelUse: MachInstLabelUse;
|
||||
|
||||
Reference in New Issue
Block a user