From 8e7993a63e32981757c4d65fe6519439dde97d8e Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 2 Sep 2025 16:40:38 +0200 Subject: assembler: Add support for asan:reserve,ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the initial support for both directives for the address sanitizer. Note that asan:weak has been moved into asan:ignore, which is not exactly the same but for now it should suffice. Signed-off-by: Miquel Sabaté Solà --- lib/xixanta/src/object.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/xixanta/src/object.rs') diff --git a/lib/xixanta/src/object.rs b/lib/xixanta/src/object.rs index 373d06c..920a4f8 100644 --- a/lib/xixanta/src/object.rs +++ b/lib/xixanta/src/object.rs @@ -101,7 +101,8 @@ impl Bundle { } /// The type of object being referenced, which is either a value as-is, or an -/// address that needs to be interpreted when fetching it. +/// address that needs to be interpreted when fetching it; or a reference to a +/// value (i.e. something the address sanitizer can ignore). #[derive(Debug, Clone)] pub enum ObjectType { Address, @@ -132,6 +133,12 @@ pub struct Object { /// The type for this object. pub object_type: ObjectType, + + /// Whether the address sanitizer should ignore this object or not. + pub asan_ignore: bool, + + /// Amount of bytes reserved for this object on the address sanitizer. + pub asan_reserve: u8, } impl Object { @@ -143,6 +150,8 @@ impl Object { mapping, segment, object_type, + asan_ignore: false, + asan_reserve: 1, } } } -- cgit v1.2.3