let object = read::File::parse(&*bytes).unwrap();
assert_eq!(object.format(), BinaryFormat::MachO);
assert_eq!(object.architecture(), Architecture::X86_64);
letmut sections = object.sections();
let common = sections.next().unwrap();
println!("{:?}", common); let common_index = common.index();
assert_eq!(common.name(), Ok("__common"));
assert_eq!(common.segment_name(), Ok(Some("__DATA")));
assert_eq!(common.kind(), SectionKind::Common);
assert_eq!(common.size(), 16);
assert_eq!(common.data(), Ok(&[][..]));
let section = sections.next();
assert!(section.is_none(), "unexpected section {:?}", section);
letmut symbols = object.symbols();
let symbol = symbols.next().unwrap();
println!("{:?}", symbol);
assert_eq!(symbol.name(), Ok("_v1"));
assert_eq!(symbol.kind(), SymbolKind::Data);
assert_eq!(symbol.section_index(), Some(common_index));
assert_eq!(symbol.scope(), SymbolScope::Linkage);
assert!(!symbol.is_weak());
assert!(!symbol.is_undefined());
assert_eq!(symbol.address(), 0);
let symbol = symbols.next().unwrap();
println!("{:?}", symbol);
assert_eq!(symbol.name(), Ok("_v2"));
assert_eq!(symbol.kind(), SymbolKind::Data);
assert_eq!(symbol.section_index(), Some(common_index));
assert_eq!(symbol.scope(), SymbolScope::Linkage);
assert!(!symbol.is_weak());
assert!(!symbol.is_undefined());
assert_eq!(symbol.address(), 8);
let symbol = symbols.next();
assert!(symbol.is_none(), "unexpected symbol {:?}", symbol);
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
(vorverarbeitet am 2026-10-05)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.