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

[Mach-O] wip

This commit is contained in:
Rui Ueyama 2021-10-07 19:17:18 +09:00
parent 91ec5ae972
commit 86c8b77dd6
2 changed files with 11 additions and 4 deletions

View File

@ -121,13 +121,15 @@ void dump_unwind_info(u8 *buf, MachSection &sec) {
<< "\n encodingsPageOffset: 0x" << hdr2.encodingsPageOffset
<< "\n encodingsCount: 0x" << hdr2.encodingsCount;
u32 *ent2 = (u32 *)(addr + hdr2.entryPageOffset);
UnwindCompressedEntry *ent2 =
(UnwindCompressedEntry *)(addr + hdr2.entryPageOffset);
for (i64 j = 0; j < hdr2.entryCount; j++)
std::cout << std::hex << "\n 0x" << ent2[j];
std::cout << std::hex << "\n 0x"
<< ent2[j].func_off << " 0x" << ent2[j].encoding;
ent2 = (u32 *)(addr + hdr2.encodingsPageOffset);
u32 *enc = (u32 *)(addr + hdr2.encodingsPageOffset);
for (i64 j = 0; j < hdr2.encodingsCount; j++)
std::cout << std::hex << "\n 0x" << ent2[j];
std::cout << std::hex << "\n 0x" << enc[j];
break;
}
default:

View File

@ -537,4 +537,9 @@ struct UnwindInfoCompressedSecondLevelPageHeader {
// encodings array
};
struct UnwindCompressedEntry {
u32 func_off : 24;
u32 encoding : 8;
};
} // namespace mold::macho