summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-02-19 01:28:30 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-02-19 01:28:30 +0000
commitb9ea63c551f667af119cce25e1b5a59b8bbe8091 (patch)
treee1d879ee81b6312f035044601fcd2d6179c5e6f0 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentb32d009b4f51fcd6c055f88d4085620c7a040550 (diff)
downloadbcm5719-llvm-b9ea63c551f667af119cce25e1b5a59b8bbe8091.tar.gz
bcm5719-llvm-b9ea63c551f667af119cce25e1b5a59b8bbe8091.zip
Avoid an infinite cycle with private linkage and -f{data|function}-sections.
When outputting an object we check its section to find its name, but when looking for the section with -ffunction-section we look for the symbol name. Break the loop by requesting a name with the private prefix when constructing the section name. This matches the behavior before r201608. llvm-svn: 201622
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 1bb483f0157..bd54a871ca3 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -248,12 +248,12 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Prefix = getSectionPrefixForGlobal(Kind);
SmallString<128> Name(Prefix, Prefix+strlen(Prefix));
- MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
- Name.append(Sym->getName().begin(), Sym->getName().end());
+ TM.getTargetLowering()->getNameWithPrefix(Name, GV, Mang, true);
+
StringRef Group = "";
unsigned Flags = getELFSectionFlags(Kind);
if (GV->isWeakForLinker()) {
- Group = Sym->getName();
+ Group = Name.substr(strlen(Prefix));
Flags |= ELF::SHF_GROUP;
}
OpenPOWER on IntegriCloud