This is an archive of the discontinued LLVM Phabricator instance.

[llvm] Teach LLVM about filesets
ClosedPublic

Authored by JDevlieghere on Aug 22 2022, 9:43 PM.

Details

Summary

Teach LLVM about filesets. Filesets were added in macOS 11 (Big Sur) to combine multiple Mach-O files. They consist of a load command (LC_FILESET_ENTRY) consisting of a fileset_entry_command.

struct fileset_entry_command {
    uint32_t     cmd;        /* LC_FILESET_ENTRY */
    uint32_t     cmdsize;    /* includes entry_id string */
    uint64_t     vmaddr;     /* memory address of the entry */
    uint64_t     fileoff;    /* file offset of the entry */
    union lc_str entry_id;   /* contained entry id */
    uint32_t     reserved;   /* reserved */
};

[1] https://github.com/apple-oss-distributions/xnu/blob/e7776783b89a353188416a9a346c6cdb4928faad/EXTERNAL_HEADERS/mach-o/loader.h#L326

Diff Detail

Event Timeline

JDevlieghere created this revision.Aug 22 2022, 9:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 9:43 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
JDevlieghere requested review of this revision.Aug 22 2022, 9:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 9:43 PM
jasonmolenda accepted this revision.Aug 23 2022, 1:43 PM

Looks good to me.

This revision is now accepted and ready to land.Aug 23 2022, 1:43 PM
pete accepted this revision.Aug 23 2022, 2:14 PM
This revision was automatically updated to reflect the committed changes.