Skip to content

MachoSection

Description

Decoded section_64. Each segment contains zero or more sections; DWARF lives in the __DWARF segment, code lives in __TEXT.

Usage example (Cross-references)

Usage examples (Cross-references)
            return false;
    
        const MachoSection *info_sec   = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_info");
        const MachoSection *abbrev_sec = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_abbrev");
        const MachoSection *str_sec    = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_str");
    
        const MachoSection *info_sec   = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_info");
        const MachoSection *abbrev_sec = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_abbrev");
        const MachoSection *str_sec    = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_str");
        const MachoSection *info_sec   = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_info");
        const MachoSection *abbrev_sec = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_abbrev");
        const MachoSection *str_sec    = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_str");
    
        const u8 *info_b   = info_sec ? e->dsym.data + info_sec->offset : NULL;
            }
            const u8    *s = cmd_p + sect_off;
            MachoSection sec;
            MemSet(&sec, 0, sizeof(sec));
            copy_fixed16(sec.section, s + 0);
    }
    
    const MachoSection *MachoFileFindSection(const MachoFile *self, const char *segment, const char *section) {
        if (!self || !segment || !section)
            return NULL;
            return NULL;
        for (size i = 0; i < self->sections.length; ++i) {
            const MachoSection *s = &self->sections.data[i];
            if (ZstrCompare(s->segment, segment) == 0 && ZstrCompare(s->section, section) == 0) {
                return s;
        u32  offset; // file offset
        u32  flags;
    } MachoSection;
    
    ///
    
    typedef Vec(MachoSegment) MachoSegments;
    typedef Vec(MachoSection) MachoSections;
    typedef Vec(MachoSymbol) MachoSymbols;
    /// absent.
    ///
    const MachoSection *MachoFileFindSection(const MachoFile *self, const char *segment, const char *section);
    
    ///
Last updated on