aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2023-11-28 14:14:40 -0800
committerArthur Eubanks <aeubanks@google.com>2023-11-28 14:14:40 -0800
commitd8d9394cb0ec052d54f51d50d33e76062bf63e9a (patch)
tree384b9a8fa868efc9f143c0d966c5deb66f56e8ac /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent3661eb150e6d4e1e06adb8a62c4b45b056f3c8be (diff)
downloadllvm-d8d9394cb0ec052d54f51d50d33e76062bf63e9a.zip
llvm-d8d9394cb0ec052d54f51d50d33e76062bf63e9a.tar.gz
llvm-d8d9394cb0ec052d54f51d50d33e76062bf63e9a.tar.bz2
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.
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 143a495..f3ba38081 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<GlobalVariable>(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<GlobalVariable>(GO)) {
+ if (TM.isLargeData(GV)) {
+ assert(TM.getTargetTriple().getArch() == Triple::x86_64);
+ Flags |= ELF::SHF_X86_64_LARGE;
+ }
+ }
return {Group, IsComdat, Flags};
}