VirtualBox

source: vbox/trunk/src/VBox/Runtime/include/internal/compiler-vcc.h@ 97378

最後變更 在這個檔案從97378是 96588,由 vboxsync 提交於 3 年 前

IPRT/nocrt: Added workaround for NT3.1 not knowing about Misc.VirtualSize and not clearing uninitialized data at the end of sections. bugref:10261

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 4.1 KB
 
1/* $Id: compiler-vcc.h 96588 2022-09-03 02:40:14Z vboxsync $ */
2/** @file
3 * IPRT - Internal header for the Visual C++ Compiler Support Code.
4 */
5
6/*
7 * Copyright (C) 2022 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.alldomusa.eu.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * The contents of this file may alternatively be used under the terms
26 * of the Common Development and Distribution License Version 1.0
27 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
28 * in the VirtualBox distribution, in which case the provisions of the
29 * CDDL are applicable instead of those of the GPL.
30 *
31 * You may elect to license modified versions of this file under the
32 * terms and conditions of either the GPL or the CDDL or both.
33 *
34 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
35 */
36
37#ifndef IPRT_INCLUDED_INTERNAL_compiler_vcc_h
38#define IPRT_INCLUDED_INTERNAL_compiler_vcc_h
39#ifndef RT_WITHOUT_PRAGMA_ONCE
40# pragma once
41#endif
42
43#include <iprt/types.h>
44
45/** @name Special sections.
46 * @{
47 */
48
49#ifdef IPRT_COMPILER_VCC_WITH_C_INIT_TERM_SECTIONS
50# pragma section(".CRT$XIA", read, long) /* start C initializers */
51# pragma section(".CRT$XIAA", read, long)
52# pragma section(".CRT$XIZ", read, long)
53
54# pragma section(".CRT$XPA", read, long) /* start early C terminators */
55# pragma section(".CRT$XPAA", read, long)
56# pragma section(".CRT$XPZ", read, long)
57
58# pragma section(".CRT$XTA", read, long) /* start C terminators */
59# pragma section(".CRT$XTAA", read, long)
60# pragma section(".CRT$XTZ", read, long)
61# define IPRT_COMPILER_TERM_CALLBACK(a_fn) \
62 __declspec(allocate(".CRT$XTAA")) PFNRT RT_CONCAT(g_rtVccTermCallback_, a_fn) = a_fn
63#endif
64
65#ifdef IPRT_COMPILER_VCC_WITH_CPP_INIT_SECTIONS
66# pragma warning(disable:5247) /* warning C5247: section '.CRT$XCA' is reserved for C++ dynamic initialization. Manually creating the section will interfere with C++ dynamic initialization and may lead to undefined behavior */
67# pragma warning(disable:5248) /* warning C5248: section '.CRT$XCA' is reserved for C++ dynamic initialization. Variables manually put into the section may be optimized out and their order relative to compiler generated dynamic initializers is unspecified */
68# pragma section(".CRT$XCA", read, long) /* start C++ initializers */
69# pragma section(".CRT$XCAA", read, long)
70# pragma section(".CRT$XCZ", read, long)
71#endif
72
73#ifdef IPRT_COMPILER_VCC_WITH_RTC_INIT_TERM_SECTIONS
74# pragma section(".rtc$IAA", read, long) /* start RTC initializers */
75# pragma section(".rtc$IZZ", read, long)
76
77# pragma section(".rtc$TAA", read, long) /* start RTC terminators */
78# pragma section(".rtc$TZZ", read, long)
79#endif
80
81#ifdef IPRT_COMPILER_VCC_WITH_TLS_CALLBACK_SECTIONS
82# pragma section(".CRT$XLA", read, long) /* start TLS callback */
83# pragma section(".CRT$XLAA", read, long)
84# pragma section(".CRT$XLZ", read, long)
85
86/** @todo what about .CRT$XDA? Dynamic TLS initializers. */
87#endif
88
89#ifdef IPRT_COMPILER_VCC_WITH_TLS_DATA_SECTIONS
90# pragma section(".tls", read, long) /* start TLS callback */
91# pragma section(".tls$ZZZ", read, long)
92
93/** @todo what about .CRT$XDA? Dynamic TLS initializers. */
94#endif
95
96/** @} */
97
98
99RT_C_DECLS_BEGIN
100
101extern unsigned _fltused;
102
103void rtVccInitSecurityCookie(void) RT_NOEXCEPT;
104void rtVccWinInitBssOnNt3(void *pvImageBase) RT_NOEXCEPT;
105void rtVccWinInitProcExecPath(void) RT_NOEXCEPT;
106int rtVccInitializersRunInit(void) RT_NOEXCEPT;
107void rtVccInitializersRunTerm(void) RT_NOEXCEPT;
108void rtVccTermRunAtExit(void) RT_NOEXCEPT;
109
110
111RT_C_DECLS_END
112
113
114#endif /* !IPRT_INCLUDED_INTERNAL_compiler_vcc_h */
115
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette