[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)

* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally
* Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it
* Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC)
* Place INIT_FUNCTION before the return type (required by MSVC)
* Make sure declarations and implementations share the same modifiers (required by MSVC)
* Add a global linker option to suppress warnings about defined but unused INIT section
* Merge INIT section into .text in freeldr
This commit is contained in:
Timo Kreuzer 2018-12-30 12:19:11 +01:00 committed by GitHub
parent 7c66247343
commit 71fefa32db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 522 additions and 296 deletions

View file

@ -24,6 +24,7 @@ Author:
//
#include <umtypes.h>
#include <ketypes.h>
#include <section_attribs.h>
#ifndef NTOS_MODE_USER
@ -244,6 +245,7 @@ KeSignalCallDpcSynchronize(
// ARC Configuration Functions. Only enabled if you have ARC Support
//
#ifdef _ARC_
INIT_FUNCTION
PCONFIGURATION_COMPONENT_DATA
NTAPI
KeFindConfigurationNextEntry(
@ -254,6 +256,7 @@ KeFindConfigurationNextEntry(
_In_ PCONFIGURATION_COMPONENT_DATA *NextLink
);
INIT_FUNCTION
PCONFIGURATION_COMPONENT_DATA
NTAPI
KeFindConfigurationEntry(