aboutsummaryrefslogtreecommitdiff
path: root/lib/xixanta/src/object.rs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-09-02 16:40:38 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-09-02 16:40:38 +0200
commit8e7993a63e32981757c4d65fe6519439dde97d8e (patch)
tree082979ffe3d3b1880c02d3e56f2fd4a47b93094e /lib/xixanta/src/object.rs
parentfb2d20e715dd04d27c4873c4989202133783f161 (diff)
downloadtools.nes-8e7993a63e32981757c4d65fe6519439dde97d8e.tar.gz
tools.nes-8e7993a63e32981757c4d65fe6519439dde97d8e.zip
assembler: Add support for asan:reserve,ignore
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à <mikisabate@gmail.com>
Diffstat (limited to 'lib/xixanta/src/object.rs')
-rw-r--r--lib/xixanta/src/object.rs11
1 files changed, 10 insertions, 1 deletions
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,
}
}
}