mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Emit dtors into proper section while compiling in vcpp-compatible mode.
Patch by Kai! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164476 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -430,12 +430,20 @@ void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) {
|
||||
}
|
||||
|
||||
|
||||
StaticDtorSection =
|
||||
Ctx->getCOFFSection(".dtors",
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ |
|
||||
COFF::IMAGE_SCN_MEM_WRITE,
|
||||
SectionKind::getDataRel());
|
||||
if (T.getOS() == Triple::Win32) {
|
||||
StaticDtorSection =
|
||||
Ctx->getCOFFSection(".CRT$XTX",
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ,
|
||||
SectionKind::getReadOnly());
|
||||
} else {
|
||||
StaticDtorSection =
|
||||
Ctx->getCOFFSection(".dtors",
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ |
|
||||
COFF::IMAGE_SCN_MEM_WRITE,
|
||||
SectionKind::getDataRel());
|
||||
}
|
||||
|
||||
// FIXME: We're emitting LSDA info into a readonly section on COFF, even
|
||||
// though it contains relocatable pointers. In PIC mode, this is probably a
|
||||
|
||||
Reference in New Issue
Block a user