@@ -476,16 +476,19 @@ PACKED_STRUCT_END
476476/**
477477 * Linux DSO debug structures (MD_LINUX_DSO_DEBUG, 0x4767000A)
478478 *
479- * Mirrors Breakpad's MDRawLinkMap64 / MDRawDebug64. LLDB and rust-minidump
480- * use this stream to enumerate loaded shared objects when LinuxAuxv alone
481- * isn't enough (e.g. modules loaded via dlopen after process startup that
482- * aren't in /proc/<pid>/maps in a usable order).
479+ * Wire-compatible with Breakpad's MDRawLinkMap64 / MDRawDebug64. Breakpad
480+ * builds these under `#pragma pack(push, 4)`, so a uint64_t can sit on a
481+ * 4-byte boundary with no padding inserted between the preceding uint32_t
482+ * and itself. We use PACKED_ATTR (== __attribute__((packed))) to get the
483+ * same byte-exact layout: 20 bytes for link_map64, 36 bytes for debug64.
484+ *
485+ * Adding explicit _pad fields here would break the layout — LLDB and
486+ * rust-minidump compute offsets assuming the Breakpad sizes.
483487 */
484488PACKED_STRUCT_BEGIN
485489typedef struct {
486490 uint64_t addr ; // l_addr from struct link_map
487491 minidump_rva_t name ; // RVA to MINIDUMP_STRING with the SO path
488- uint32_t _pad ;
489492 uint64_t ld ; // l_ld from struct link_map (PT_DYNAMIC of this DSO)
490493} PACKED_ATTR minidump_link_map64_t ;
491494PACKED_STRUCT_END
@@ -495,7 +498,6 @@ typedef struct {
495498 uint32_t version ; // r_debug.r_version
496499 minidump_rva_t map ; // RVA to array of minidump_link_map64_t
497500 uint32_t dso_count ; // number of entries in map
498- uint32_t _pad ;
499501 uint64_t brk ; // r_debug.r_brk
500502 uint64_t ldbase ; // r_debug.r_ldbase
501503 uint64_t dynamic ; // address of the program's _DYNAMIC section
0 commit comments