@@ -232,9 +232,8 @@ const MCExpr *TargetLoweringObjectFileELF::getTTypeGlobalReference(
232232 MMI, Streamer);
233233}
234234
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.
238237 // We follow gcc, MC follows gas. For example, given ".section .eh_frame",
239238 // both gas and MC will produce a section with no flags. Given
240239 // section(".eh_frame") gcc will produce:
@@ -265,7 +264,6 @@ static SectionKind getELFKindForNamedSection(StringRef Name, SectionKind K,
265264 return SectionKind::getThreadData ();
266265
267266 if (Name == " .tbss" ||
268- (TargetTriple.isAndroid () && Name == " .tcommon" ) || // LDC
269267 Name.startswith (" .tbss." ) ||
270268 Name.startswith (" .gnu.linkonce.tb." ) ||
271269 Name.startswith (" .llvm.linkonce.tb." ))
@@ -296,7 +294,7 @@ static unsigned getELFSectionType(StringRef Name, SectionKind K) {
296294 return ELF::SHT_PROGBITS;
297295}
298296
299- static unsigned getELFSectionFlags (SectionKind K, const Triple &TargetTriple ) {
297+ static unsigned getELFSectionFlags (SectionKind K) {
300298 unsigned Flags = 0 ;
301299
302300 if (!K.isMetadata ())
@@ -311,7 +309,7 @@ static unsigned getELFSectionFlags(SectionKind K, const Triple &TargetTriple) {
311309 if (K.isWriteable ())
312310 Flags |= ELF::SHF_WRITE;
313311
314- if (K.isThreadLocal () && !TargetTriple. isAndroid ()) // LDC
312+ if (K.isThreadLocal ())
315313 Flags |= ELF::SHF_TLS;
316314
317315 if (K.isMergeableCString () || K.isMergeableConst ())
@@ -377,10 +375,10 @@ MCSection *TargetLoweringObjectFileELF::getExplicitSectionGlobal(
377375 }
378376
379377 // Infer section flags from the section name if we can.
380- Kind = getELFKindForNamedSection (SectionName, Kind, getTargetTriple () );
378+ Kind = getELFKindForNamedSection (SectionName, Kind);
381379
382380 StringRef Group = " " ;
383- unsigned Flags = getELFSectionFlags (Kind, getTargetTriple () );
381+ unsigned Flags = getELFSectionFlags (Kind);
384382 if (const Comdat *C = getELFComdat (GO)) {
385383 Group = C->getName ();
386384 Flags |= ELF::SHF_GROUP;
@@ -504,7 +502,7 @@ static MCSectionELF *selectELFSectionForGlobal(
504502
505503MCSection *TargetLoweringObjectFileELF::SelectSectionForGlobal (
506504 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
507- unsigned Flags = getELFSectionFlags (Kind, getTargetTriple () );
505+ unsigned Flags = getELFSectionFlags (Kind);
508506
509507 // If we have -ffunction-section or -fdata-section then we should emit the
510508 // global value to a uniqued section specifically for it.
0 commit comments