@@ -76,31 +76,29 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(Triple T) {
76
76
MachO::S_ATTR_PURE_INSTRUCTIONS,
77
77
SectionKind::getText ());
78
78
DataSection // .data
79
- = Ctx->getMachOSection (" __DATA" , " __data" , 0 ,
80
- SectionKind::getDataRel ());
79
+ = Ctx->getMachOSection (" __DATA" , " __data" , 0 , SectionKind::getData ());
81
80
82
81
// BSSSection might not be expected initialized on msvc.
83
82
BSSSection = nullptr ;
84
83
85
84
TLSDataSection // .tdata
86
- = Ctx->getMachOSection (" __DATA" , " __thread_data" ,
87
- MachO::S_THREAD_LOCAL_REGULAR,
88
- SectionKind::getDataRel ());
85
+ = Ctx->getMachOSection (" __DATA" , " __thread_data" ,
86
+ MachO::S_THREAD_LOCAL_REGULAR,
87
+ SectionKind::getData ());
89
88
TLSBSSSection // .tbss
90
89
= Ctx->getMachOSection (" __DATA" , " __thread_bss" ,
91
90
MachO::S_THREAD_LOCAL_ZEROFILL,
92
91
SectionKind::getThreadBSS ());
93
92
94
93
// TODO: Verify datarel below.
95
94
TLSTLVSection // .tlv
96
- = Ctx->getMachOSection (" __DATA" , " __thread_vars" ,
97
- MachO::S_THREAD_LOCAL_VARIABLES,
98
- SectionKind::getDataRel ());
95
+ = Ctx->getMachOSection (" __DATA" , " __thread_vars" ,
96
+ MachO::S_THREAD_LOCAL_VARIABLES,
97
+ SectionKind::getData ());
99
98
100
- TLSThreadInitSection
101
- = Ctx->getMachOSection (" __DATA" , " __thread_init" ,
102
- MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
103
- SectionKind::getDataRel ());
99
+ TLSThreadInitSection = Ctx->getMachOSection (
100
+ " __DATA" , " __thread_init" , MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
101
+ SectionKind::getData ());
104
102
105
103
CStringSection // .cstring
106
104
= Ctx->getMachOSection (" __TEXT" , " __cstring" ,
@@ -145,10 +143,8 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(Triple T) {
145
143
= Ctx->getMachOSection (" __TEXT" , " __const_coal" ,
146
144
MachO::S_COALESCED,
147
145
SectionKind::getReadOnly ());
148
- DataCoalSection
149
- = Ctx->getMachOSection (" __DATA" ," __datacoal_nt" ,
150
- MachO::S_COALESCED,
151
- SectionKind::getDataRel ());
146
+ DataCoalSection = Ctx->getMachOSection (
147
+ " __DATA" , " __datacoal_nt" , MachO::S_COALESCED, SectionKind::getData ());
152
148
} else {
153
149
TextCoalSection = TextSection;
154
150
ConstTextCoalSection = ReadOnlySection;
@@ -177,21 +173,17 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(Triple T) {
177
173
SectionKind::getMetadata ());
178
174
179
175
if (RelocM == Reloc::Static) {
180
- StaticCtorSection
181
- = Ctx->getMachOSection (" __TEXT" , " __constructor" , 0 ,
182
- SectionKind::getDataRel ());
183
- StaticDtorSection
184
- = Ctx->getMachOSection (" __TEXT" , " __destructor" , 0 ,
185
- SectionKind::getDataRel ());
176
+ StaticCtorSection = Ctx->getMachOSection (" __TEXT" , " __constructor" , 0 ,
177
+ SectionKind::getData ());
178
+ StaticDtorSection = Ctx->getMachOSection (" __TEXT" , " __destructor" , 0 ,
179
+ SectionKind::getData ());
186
180
} else {
187
- StaticCtorSection
188
- = Ctx->getMachOSection (" __DATA" , " __mod_init_func" ,
189
- MachO::S_MOD_INIT_FUNC_POINTERS,
190
- SectionKind::getDataRel ());
191
- StaticDtorSection
192
- = Ctx->getMachOSection (" __DATA" , " __mod_term_func" ,
193
- MachO::S_MOD_TERM_FUNC_POINTERS,
194
- SectionKind::getDataRel ());
181
+ StaticCtorSection = Ctx->getMachOSection (" __DATA" , " __mod_init_func" ,
182
+ MachO::S_MOD_INIT_FUNC_POINTERS,
183
+ SectionKind::getData ());
184
+ StaticDtorSection = Ctx->getMachOSection (" __DATA" , " __mod_term_func" ,
185
+ MachO::S_MOD_TERM_FUNC_POINTERS,
186
+ SectionKind::getData ());
195
187
}
196
188
197
189
// Exception Handling.
@@ -452,9 +444,6 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(Triple T) {
452
444
TLSBSSSection = Ctx->getELFSection (
453
445
" .tbss" , ELF::SHT_NOBITS, ELF::SHF_ALLOC | ELF::SHF_TLS | ELF::SHF_WRITE);
454
446
455
- DataRelSection = Ctx->getELFSection (" .data.rel" , ELF::SHT_PROGBITS,
456
- ELF::SHF_ALLOC | ELF::SHF_WRITE);
457
-
458
447
DataRelROSection = Ctx->getELFSection (" .data.rel.ro" , ELF::SHT_PROGBITS,
459
448
ELF::SHF_ALLOC | ELF::SHF_WRITE);
460
449
@@ -556,7 +545,7 @@ void MCObjectFileInfo::initCOFFMCObjectFileInfo(Triple T) {
556
545
EHFrameSection = Ctx->getCOFFSection (
557
546
" .eh_frame" , COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
558
547
COFF::IMAGE_SCN_MEM_READ | COFF::IMAGE_SCN_MEM_WRITE,
559
- SectionKind::getDataRel ());
548
+ SectionKind::getData ());
560
549
561
550
bool IsWoA = T.getArch () == Triple::arm || T.getArch () == Triple::thumb;
562
551
@@ -576,7 +565,7 @@ void MCObjectFileInfo::initCOFFMCObjectFileInfo(Triple T) {
576
565
DataSection = Ctx->getCOFFSection (
577
566
" .data" , COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ |
578
567
COFF::IMAGE_SCN_MEM_WRITE,
579
- SectionKind::getDataRel ());
568
+ SectionKind::getData ());
580
569
ReadOnlySection = Ctx->getCOFFSection (
581
570
" .rdata" , COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ,
582
571
SectionKind::getReadOnly ());
@@ -594,11 +583,11 @@ void MCObjectFileInfo::initCOFFMCObjectFileInfo(Triple T) {
594
583
StaticCtorSection = Ctx->getCOFFSection (
595
584
" .ctors" , COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
596
585
COFF::IMAGE_SCN_MEM_READ | COFF::IMAGE_SCN_MEM_WRITE,
597
- SectionKind::getDataRel ());
586
+ SectionKind::getData ());
598
587
StaticDtorSection = Ctx->getCOFFSection (
599
588
" .dtors" , COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
600
589
COFF::IMAGE_SCN_MEM_READ | COFF::IMAGE_SCN_MEM_WRITE,
601
- SectionKind::getDataRel ());
590
+ SectionKind::getData ());
602
591
}
603
592
604
593
// FIXME: We're emitting LSDA info into a readonly section on COFF, even
@@ -751,19 +740,19 @@ void MCObjectFileInfo::initCOFFMCObjectFileInfo(Triple T) {
751
740
752
741
PDataSection = Ctx->getCOFFSection (
753
742
" .pdata" , COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ,
754
- SectionKind::getDataRel ());
743
+ SectionKind::getData ());
755
744
756
745
XDataSection = Ctx->getCOFFSection (
757
746
" .xdata" , COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ,
758
- SectionKind::getDataRel ());
747
+ SectionKind::getData ());
759
748
760
749
SXDataSection = Ctx->getCOFFSection (" .sxdata" , COFF::IMAGE_SCN_LNK_INFO,
761
750
SectionKind::getMetadata ());
762
751
763
752
TLSDataSection = Ctx->getCOFFSection (
764
753
" .tls$" , COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ |
765
754
COFF::IMAGE_SCN_MEM_WRITE,
766
- SectionKind::getDataRel ());
755
+ SectionKind::getData ());
767
756
768
757
StackMapSection = Ctx->getCOFFSection (" .llvm_stackmaps" ,
769
758
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
0 commit comments