From d8d9394cb0ec052d54f51d50d33e76062bf63e9a Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Tue, 28 Nov 2023 14:14:40 -0800 Subject: Revert "[X86] With large code model, put functions into .ltext with large section flag (#73037)" This reverts commit 38e435895779c6f0e6c47a171f3b300ad99828b3. May be culprit for https://lab.llvm.org/buildbot/#/builders/37/builds/28079/steps/9/logs/stdio. --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 143a4951c136..f3ba38081890 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -616,7 +616,7 @@ static unsigned getEntrySizeForKind(SectionKind Kind) { /// DataSections. static StringRef getSectionPrefixForGlobal(SectionKind Kind, bool IsLarge) { if (Kind.isText()) - return IsLarge ? ".ltext" : ".text"; + return ".text"; if (Kind.isReadOnly()) return IsLarge ? ".lrodata" : ".rodata"; if (Kind.isBSS()) @@ -650,7 +650,10 @@ getELFSectionNameForGlobal(const GlobalObject *GO, SectionKind Kind, Name = ".rodata.cst"; Name += utostr(EntrySize); } else { - Name = getSectionPrefixForGlobal(Kind, TM.isLargeGlobalObject(GO)); + bool IsLarge = false; + if (auto *GV = dyn_cast(GO)) + IsLarge = TM.isLargeData(GV); + Name = getSectionPrefixForGlobal(Kind, IsLarge); } bool HasPrefix = false; @@ -770,8 +773,12 @@ getGlobalObjectInfo(const GlobalObject *GO, const TargetMachine &TM) { Group = C->getName(); IsComdat = C->getSelectionKind() == Comdat::Any; } - if (TM.isLargeGlobalObject(GO)) - Flags |= ELF::SHF_X86_64_LARGE; + if (auto *GV = dyn_cast(GO)) { + if (TM.isLargeData(GV)) { + assert(TM.getTargetTriple().getArch() == Triple::x86_64); + Flags |= ELF::SHF_X86_64_LARGE; + } + } return {Group, IsComdat, Flags}; } -- cgit v1.2.3