mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Don't filter ELF exports by functions
Since we export a constant for CLAP.
This commit is contained in:
@@ -10,11 +10,11 @@ pub fn exported<P: AsRef<Path>>(binary: P, symbol: &str) -> Result<bool> {
|
|||||||
let bytes = fs::read(&binary)
|
let bytes = fs::read(&binary)
|
||||||
.with_context(|| format!("Could not read '{}'", binary.as_ref().display()))?;
|
.with_context(|| format!("Could not read '{}'", binary.as_ref().display()))?;
|
||||||
match goblin::Object::parse(&bytes)? {
|
match goblin::Object::parse(&bytes)? {
|
||||||
goblin::Object::Elf(obj) => Ok(obj.dynsyms.iter().any(|sym| {
|
goblin::Object::Elf(obj) => Ok(obj
|
||||||
!sym.is_import()
|
.dynsyms
|
||||||
&& sym.is_function()
|
.iter()
|
||||||
&& obj.dynstrtab.get_at(sym.st_name) == Some(symbol)
|
// We don't filter by functions here since we need to export a constant for CLAP
|
||||||
})),
|
.any(|sym| !sym.is_import() && obj.dynstrtab.get_at(sym.st_name) == Some(symbol))),
|
||||||
goblin::Object::Mach(obj) => {
|
goblin::Object::Mach(obj) => {
|
||||||
let obj = match obj {
|
let obj = match obj {
|
||||||
goblin::mach::Mach::Fat(arches) => arches
|
goblin::mach::Mach::Fat(arches) => arches
|
||||||
|
|||||||
Reference in New Issue
Block a user