Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenBSD support #55

Merged
merged 4 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
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
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