From 039a0b93d7646e5883d7adbc89eb00063368b0d1 Mon Sep 17 00:00:00 2001 From: Mattiwatti Date: Wed, 29 Nov 2017 17:01:15 +0100 Subject: [PATCH] Make ZydisWinKernel compatible with Clang --- examples/ZydisWinKernel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/ZydisWinKernel.c b/examples/ZydisWinKernel.c index 6c0e2b2..c50ee01 100644 --- a/examples/ZydisWinKernel.c +++ b/examples/ZydisWinKernel.c @@ -58,10 +58,13 @@ RtlImageNtHeader( _In_ PVOID ImageBase ); +#if defined(ZYDIS_CLANG) || defined(ZYDIS_GNUC) +__attribute__((section("INIT"))) +#endif DRIVER_INITIALIZE DriverEntry; -#ifdef ALLOC_PRAGMA +#if defined(ALLOC_PRAGMA) && !(defined(ZYDIS_CLANG) || defined(ZYDIS_GNUC)) #pragma alloc_text(INIT, DriverEntry) #endif