1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-13 09:39:13 +03:00

[Mach-O] wip

This commit is contained in:
Rui Ueyama 2021-09-14 15:57:22 +09:00
parent 568bba75c6
commit 90380ed232
2 changed files with 13 additions and 8 deletions

View File

@ -250,19 +250,15 @@ struct Section {
u32 reserved3;
};
struct Dylib {
struct DylibCommand {
u32 cmd;
u32 cmdsize;
u32 nameoff;
u32 timestamp;
u32 current_version;
u32 compatibility_version;
};
struct DylibCommand {
u32 cmd;
u32 cmdsize;
Dylib dylib;
};
struct DylinkerCommand {
u32 cmd;
u32 cmdsize;

View File

@ -87,9 +87,18 @@ int main(int argc, char **argv) {
case LC_DYSYMTAB:
std::cout << "LC_DYSYMTAB\n";
break;
case LC_LOAD_DYLIB:
case LC_LOAD_DYLIB: {
std::cout << "LC_LOAD_DYLIB\n";
DylibCommand &cmd = *(DylibCommand *)&lc;
std::cout << " cmdsize: 0x" << cmd.cmdsize
<< "\n nameoff: 0x" << cmd.nameoff
<< "\n timestamp: 0x" << cmd.timestamp
<< "\n current_version: 0x" << cmd.current_version
<< "\n compatibility_version: 0x" << cmd.compatibility_version
<< "\n data: " << (char *)((char *)&cmd + sizeof(cmd))
<< "\n";
break;
}
case LC_LOAD_DYLINKER:
std::cout << "LC_LOAD_DYLINKER\n";
break;