summaryrefslogtreecommitdiffstats
path: root/vendor/object/src/archive.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /vendor/object/src/archive.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/object/src/archive.rs')
-rw-r--r--vendor/object/src/archive.rs54
1 files changed, 53 insertions, 1 deletions
diff --git a/vendor/object/src/archive.rs b/vendor/object/src/archive.rs
index d4b419beb..6271d0736 100644
--- a/vendor/object/src/archive.rs
+++ b/vendor/object/src/archive.rs
@@ -8,6 +8,9 @@ use crate::pod::Pod;
/// File identification bytes stored at the beginning of the file.
pub const MAGIC: [u8; 8] = *b"!<arch>\n";
+/// File identification bytes at the beginning of AIX big archive.
+pub const AIX_BIG_MAGIC: [u8; 8] = *b"<bigaf>\n";
+
/// File identification bytes stored at the beginning of a thin archive.
///
/// A thin archive only contains a symbol table and file names.
@@ -36,4 +39,53 @@ pub struct Header {
pub terminator: [u8; 2],
}
-unsafe_impl_pod!(Header);
+/// The header at the start of an AIX big archive member, without name.
+#[derive(Debug, Clone, Copy)]
+#[repr(C)]
+pub struct AixHeader {
+ /// File member size in decimal.
+ pub size: [u8; 20],
+ /// Next member offset in decimal.
+ pub nxtmem: [u8; 20],
+ /// Previous member offset in decimal.
+ pub prvmem: [u8; 20],
+ /// File member date in decimal.
+ pub date: [u8; 12],
+ /// File member user id in decimal.
+ pub uid: [u8; 12],
+ /// File member group id in decimal.
+ pub gid: [u8; 12],
+ /// File member mode in octal.
+ pub mode: [u8; 12],
+ /// File member name length in decimal.
+ pub namlen: [u8; 4],
+}
+
+/// The AIX big archive's fixed length header at file beginning.
+#[derive(Debug, Clone, Copy)]
+#[repr(C)]
+pub struct AixFileHeader {
+ /// Archive magic string.
+ pub magic: [u8; 8],
+ /// Offset of member table.
+ pub memoff: [u8; 20],
+ /// Offset of global symbol table.
+ pub gstoff: [u8; 20],
+ /// Offset of global symbol table for 64-bit objects.
+ pub gst64off: [u8; 20],
+ /// Offset of first member.
+ pub fstmoff: [u8; 20],
+ /// Offset of last member.
+ pub lstmoff: [u8; 20],
+ /// Offset of first member on free list.
+ pub freeoff: [u8; 20],
+}
+
+/// Offset of a member in an AIX big archive.
+///
+/// This is used in the member index.
+#[derive(Debug, Clone, Copy)]
+#[repr(C)]
+pub struct AixMemberOffset(pub [u8; 20]);
+
+unsafe_impl_pod!(Header, AixHeader, AixFileHeader, AixMemberOffset,);