@@ -232,9 +232,8 @@ const MCExpr *TargetLoweringObjectFileELF::getTTypeGlobalReference(
232
232
MMI, Streamer);
233
233
}
234
234
235
- static SectionKind getELFKindForNamedSection (StringRef Name, SectionKind K,
236
- const Triple &TargetTriple) {
237
- // N.B.: The defaults used in here are no the same ones used in MC.
235
+ static SectionKind getELFKindForNamedSection (StringRef Name, SectionKind K) {
236
+ // N.B.: The defaults used in here are not the same ones used in MC.
238
237
// We follow gcc, MC follows gas. For example, given ".section .eh_frame",
239
238
// both gas and MC will produce a section with no flags. Given
240
239
// section(".eh_frame") gcc will produce:
@@ -265,7 +264,6 @@ static SectionKind getELFKindForNamedSection(StringRef Name, SectionKind K,
265
264
return SectionKind::getThreadData ();
266
265
267
266
if (Name == " .tbss" ||
268
- (TargetTriple.isAndroid () && Name == " .tcommon" ) || // LDC
269
267
Name.startswith (" .tbss." ) ||
270
268
Name.startswith (" .gnu.linkonce.tb." ) ||
271
269
Name.startswith (" .llvm.linkonce.tb." ))
@@ -296,7 +294,7 @@ static unsigned getELFSectionType(StringRef Name, SectionKind K) {
296
294
return ELF::SHT_PROGBITS;
297
295
}
298
296
299
- static unsigned getELFSectionFlags (SectionKind K, const Triple &TargetTriple ) {
297
+ static unsigned getELFSectionFlags (SectionKind K) {
300
298
unsigned Flags = 0 ;
301
299
302
300
if (!K.isMetadata ())
@@ -311,7 +309,7 @@ static unsigned getELFSectionFlags(SectionKind K, const Triple &TargetTriple) {
311
309
if (K.isWriteable ())
312
310
Flags |= ELF::SHF_WRITE;
313
311
314
- if (K.isThreadLocal () && !TargetTriple. isAndroid ()) // LDC
312
+ if (K.isThreadLocal ())
315
313
Flags |= ELF::SHF_TLS;
316
314
317
315
if (K.isMergeableCString () || K.isMergeableConst ())
@@ -377,10 +375,10 @@ MCSection *TargetLoweringObjectFileELF::getExplicitSectionGlobal(
377
375
}
378
376
379
377
// Infer section flags from the section name if we can.
380
- Kind = getELFKindForNamedSection (SectionName, Kind, getTargetTriple () );
378
+ Kind = getELFKindForNamedSection (SectionName, Kind);
381
379
382
380
StringRef Group = " " ;
383
- unsigned Flags = getELFSectionFlags (Kind, getTargetTriple () );
381
+ unsigned Flags = getELFSectionFlags (Kind);
384
382
if (const Comdat *C = getELFComdat (GO)) {
385
383
Group = C->getName ();
386
384
Flags |= ELF::SHF_GROUP;
@@ -504,7 +502,7 @@ static MCSectionELF *selectELFSectionForGlobal(
504
502
505
503
MCSection *TargetLoweringObjectFileELF::SelectSectionForGlobal (
506
504
const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
507
- unsigned Flags = getELFSectionFlags (Kind, getTargetTriple () );
505
+ unsigned Flags = getELFSectionFlags (Kind);
508
506
509
507
// If we have -ffunction-section or -fdata-section then we should emit the
510
508
// global value to a uniqued section specifically for it.
0 commit comments