mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-11 08:29:25 +00:00
Emit global ctors into .CRT$XCU instead of .ctors on Win32. Patch by Joe Groff!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151289 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -409,12 +409,22 @@ void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) {
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ,
|
||||
SectionKind::getReadOnly());
|
||||
StaticCtorSection =
|
||||
Ctx->getCOFFSection(".ctors",
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ |
|
||||
COFF::IMAGE_SCN_MEM_WRITE,
|
||||
SectionKind::getDataRel());
|
||||
if (T.getOS() == Triple::Win32) {
|
||||
StaticCtorSection =
|
||||
Ctx->getCOFFSection(".CRT$XCU",
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ,
|
||||
SectionKind::getReadOnly());
|
||||
} else {
|
||||
StaticCtorSection =
|
||||
Ctx->getCOFFSection(".ctors",
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ |
|
||||
COFF::IMAGE_SCN_MEM_WRITE,
|
||||
SectionKind::getDataRel());
|
||||
}
|
||||
|
||||
|
||||
StaticDtorSection =
|
||||
Ctx->getCOFFSection(".dtors",
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
|
Reference in New Issue
Block a user