Merge topic 'openbsd-elf-parsing'
480e924
OpenBSD: Enable ELF parsing and editing (#14241)
This commit is contained in:
commit
1576592d02
|
@ -11,7 +11,11 @@
|
|||
#=============================================================================
|
||||
include(CheckIncludeFile)
|
||||
# Check if we can build support for ELF parsing.
|
||||
CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
|
||||
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
|
||||
CHECK_INCLUDE_FILES("stdint.h;elf_abi.h" HAVE_ELF_H)
|
||||
else()
|
||||
CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
|
||||
endif()
|
||||
if(HAVE_ELF_H)
|
||||
set(CMAKE_USE_ELF_PARSER 1)
|
||||
else()
|
||||
|
|
|
@ -19,7 +19,12 @@
|
|||
#include <cmsys/CPU.h>
|
||||
|
||||
// Include the ELF format information system header.
|
||||
#include <elf.h>
|
||||
#if defined(__OpenBSD__)
|
||||
# include <stdint.h>
|
||||
# include <elf_abi.h>
|
||||
#else
|
||||
# include <elf.h>
|
||||
#endif
|
||||
#if defined(__sun)
|
||||
# include <sys/link.h> // For dynamic section information
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue