Don't filter ELF exports by functions
Since we export a constant for CLAP.
This commit is contained in:
parent
f0504ed59a
commit
ab30b7dc9d
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue