mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-13 23:25:06 +00:00
Add support for implicit TLS model used with MS VC runtime.
Patch by Kai Nacke! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150307 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -588,6 +588,11 @@ getCOFFSectionFlags(SectionKind K) {
|
||||
COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ |
|
||||
COFF::IMAGE_SCN_MEM_WRITE;
|
||||
else if (K.isThreadLocal())
|
||||
Flags |=
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ |
|
||||
COFF::IMAGE_SCN_MEM_WRITE;
|
||||
else if (K.isReadOnly())
|
||||
Flags |=
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
@@ -614,6 +619,8 @@ static const char *getCOFFSectionPrefixForUniqueGlobal(SectionKind Kind) {
|
||||
return ".text$";
|
||||
if (Kind.isBSS ())
|
||||
return ".bss$";
|
||||
if (Kind.isThreadLocal())
|
||||
return ".tls$";
|
||||
if (Kind.isWriteable())
|
||||
return ".data$";
|
||||
return ".rdata$";
|
||||
@@ -623,7 +630,6 @@ static const char *getCOFFSectionPrefixForUniqueGlobal(SectionKind Kind) {
|
||||
const MCSection *TargetLoweringObjectFileCOFF::
|
||||
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
Mangler *Mang, const TargetMachine &TM) const {
|
||||
assert(!Kind.isThreadLocal() && "Doesn't support TLS");
|
||||
|
||||
// If this global is linkonce/weak and the target handles this by emitting it
|
||||
// into a 'uniqued' section name, create and return the section now.
|
||||
@@ -644,6 +650,9 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
if (Kind.isText())
|
||||
return getTextSection();
|
||||
|
||||
if (Kind.isThreadLocal())
|
||||
return getTLSDataSection();
|
||||
|
||||
return getDataSection();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user