Added a dedicated file for handling the OS ABI values.

This commit is contained in:
2024-04-09 23:31:33 -05:00
parent b40418d357
commit 3a452b0922
6 changed files with 76 additions and 183 deletions
+36
View File
@@ -0,0 +1,36 @@
#include "elf_osabi.h"
#include <string.h>
char* ELFOSABISText[19] =
{
"System V ABI",
"Hewlett-Packard HP-UX ABI",
"NetBSD ABI",
"GNU / Linux ABI",
"Reserved ABI",
"Reserved ABI",
"Sun Solaris ABI",
"AIX ABI",
"IRIX ABI",
"FreeBSd ABI",
"Compaq TRU64 UNIX ABI",
"Novell Modesto ABI",
"OpenBSD ABI",
"Open VMS ABI",
"Hewlett-Packard Non-Stop Kernel ABI",
"Amiga Research OS ABI",
"The FenixOS highly scalable multi-core OS ABI",
"Nuxi CloudABI ABI",
"Stratus Technologies OpenVOS ABI"
};
void GetELFOSABIString(ELFOSABI abi, char buffer[255])
{
if (!buffer) return;
memset(buffer, '\0', 255);
if (abi >= sizeof(ELFOSABISText) / sizeof(char*)) return;
strncpy(buffer, ELFOSABISText[abi], strlen(ELFOSABISText[abi]));
}