From 7b44fc945e21ca28db2e889cd6173b9be3fc0f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 2 Jun 2022 00:08:44 +0200 Subject: [PATCH] Add more ELFOSABI constants Sourced from https://github.com/llvm/llvm-project/blob/902360d21dfb53b00fd2093488972bc422ae7941/llvm/include/llvm/BinaryFormat/ELF.h#L339-L368 --- crates/examples/src/readobj/elf.rs | 6 ++++++ src/elf.rs | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/crates/examples/src/readobj/elf.rs b/crates/examples/src/readobj/elf.rs index 300b2dd0..7b8f67bc 100644 --- a/crates/examples/src/readobj/elf.rs +++ b/crates/examples/src/readobj/elf.rs @@ -795,6 +795,7 @@ static FLAGS_EI_OSABI: &[Flag] = &flags!( ELFOSABI_HPUX, ELFOSABI_NETBSD, ELFOSABI_GNU, + ELFOSABI_HURD, ELFOSABI_SOLARIS, ELFOSABI_AIX, ELFOSABI_IRIX, @@ -802,6 +803,11 @@ static FLAGS_EI_OSABI: &[Flag] = &flags!( ELFOSABI_TRU64, ELFOSABI_MODESTO, ELFOSABI_OPENBSD, + ELFOSABI_OPENVMS, + ELFOSABI_NSK, + ELFOSABI_AROS, + ELFOSABI_FENIXOS, + ELFOSABI_CLOUDABI, ELFOSABI_ARM_AEABI, ELFOSABI_ARM, ELFOSABI_STANDALONE, diff --git a/src/elf.rs b/src/elf.rs index e69e21eb..9f657726 100644 --- a/src/elf.rs +++ b/src/elf.rs @@ -162,6 +162,8 @@ pub const ELFOSABI_GNU: u8 = 3; /// /// Compatibility alias. pub const ELFOSABI_LINUX: u8 = ELFOSABI_GNU; +/// GNU/Hurd. +pub const ELFOSABI_HURD: u8 = 4; /// Sun Solaris. pub const ELFOSABI_SOLARIS: u8 = 6; /// IBM AIX. @@ -176,6 +178,16 @@ pub const ELFOSABI_TRU64: u8 = 10; pub const ELFOSABI_MODESTO: u8 = 11; /// OpenBSD. pub const ELFOSABI_OPENBSD: u8 = 12; +/// OpenVMS. +pub const ELFOSABI_OPENVMS: u8 = 13; +/// Hewlett-Packard Non-Stop Kernel. +pub const ELFOSABI_NSK: u8 = 14; +/// AROS +pub const ELFOSABI_AROS: u8 = 15; +/// FenixOS +pub const ELFOSABI_FENIXOS: u8 = 16; +/// Nuxi CloudABI +pub const ELFOSABI_CLOUDABI: u8 = 17; /// ARM EABI. pub const ELFOSABI_ARM_AEABI: u8 = 64; /// ARM.