Skip to content

Commit

Permalink
Add OpenBSD support (#55)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: 0vercl0k <[email protected]>
  • Loading branch information
jasperla and 0vercl0k authored Dec 2, 2023
1 parent b24e7f5 commit 62d0940
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/rp/elf_struct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,32 @@ static std::string type_to_str(const uint32_t p_type) {
return "PAX_FLAGS";
}

case 0x65a3dbe5: {
return "OPENBSD_MUTABLE";
}

case 0x65a3dbe6: {
return "OPENBSD_RANDOMIZE";
}

case 0x65a3dbe7: {
return "OPENBSD_WXNEEDED";
}

case 0x65a3dbe8: {
return "OPENBSD_NOBTCFI";
}

case 0x65a41be6: {
return "OPENBSD_BOOTDATA";
}

case 0x70000001: {
return "SHT_AMD64_UNWIND";
}
}

fmt::print("Unknown ELF type 0x{:x}\n", p_type);
std::abort();
return "unknown type";
}
Expand Down
4 changes: 3 additions & 1 deletion src/rp/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define WINDOWS_X64
#endif
#elif defined(linux) || defined(__linux) || defined(__FreeBSD__) || \
defined(__FreeBSD_kernel__) || defined(__MACH__)
defined(__FreeBSD_kernel__) || defined(__MACH__) || defined(__OpenBSD__)
#define LINUX

#if defined(linux) || defined(__linux)
Expand All @@ -31,6 +31,8 @@
#define SYSTEM_PLATFORM "FreeBSD"
#elif defined(__MACH__)
#define SYSTEM_PLATFORM "Mac OSX"
#elif defined(__OpenBSD__)
#define SYSTEM_PLATFORM "OpenBSD"
#else
#error An error occured
#endif
Expand Down

0 comments on commit 62d0940

Please sign in to comment.