mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Fix exported symbol detection on macOS
Apparently all exported symbols in Mach-O are prefixed with an underscore.
This commit is contained in:
@@ -23,6 +23,9 @@ pub fn exported<P: AsRef<Path>>(binary: P, symbol: &str) -> Result<bool> {
|
|||||||
goblin::mach::Mach::Binary(obj) => obj,
|
goblin::mach::Mach::Binary(obj) => obj,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// XXX: Why are all exported symbols on macOS prefixed with an underscore?
|
||||||
|
let symbol = format!("_{}", symbol);
|
||||||
|
|
||||||
Ok(obj.exports()?.into_iter().any(|sym| sym.name == symbol))
|
Ok(obj.exports()?.into_iter().any(|sym| sym.name == symbol))
|
||||||
}
|
}
|
||||||
goblin::Object::PE(obj) => Ok(obj.exports.iter().any(|sym| sym.name == Some(symbol))),
|
goblin::Object::PE(obj) => Ok(obj.exports.iter().any(|sym| sym.name == Some(symbol))),
|
||||||
|
|||||||
Reference in New Issue
Block a user