Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/mach/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ pub struct Section {
pub nreloc: u32,
/// flags (section type and attributes
pub flags: u32,
/// reserved (for offset or index)
pub reserved1: u32,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so I just realized this is technically a breaking change because you're adding fields to this type, and it's not marked exclusive and doesn't have any private fields.

/// reserved (for count or sizeof)
pub reserved2: u32,
}

impl Section {
Expand Down Expand Up @@ -107,8 +111,8 @@ impl From<Section> for Section64 {
reloff: section.reloff,
nreloc: section.nreloc,
flags: section.flags,
reserved1: 0,
reserved2: 0,
reserved1: section.reserved1,
reserved2: section.reserved2,
reserved3: 0,
}
}
Expand All @@ -126,8 +130,8 @@ impl From<Section> for Section32 {
reloff: section.reloff,
nreloc: section.nreloc,
flags: section.flags,
reserved1: 0,
reserved2: 0,
reserved1: section.reserved1,
reserved2: section.reserved2,
}
}
}
Expand All @@ -144,6 +148,8 @@ impl fmt::Debug for Section {
.field("reloff", &self.reloff)
.field("nreloc", &self.nreloc)
.field("flags", &self.flags)
.field("reserved1", &self.reserved1)
.field("reserved2", &self.reserved2)
.finish()
}
}
Expand All @@ -160,6 +166,8 @@ impl From<Section32> for Section {
reloff: section.reloff,
nreloc: section.nreloc,
flags: section.flags,
reserved1: section.reserved1,
reserved2: section.reserved2,
}
}
}
Expand All @@ -176,6 +184,8 @@ impl From<Section64> for Section {
reloff: section.reloff,
nreloc: section.nreloc,
flags: section.flags,
reserved1: section.reserved1,
reserved2: section.reserved2,
}
}
}
Expand Down